$in and $or too slow for large database (doesn´t use index)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- erlang
- Domain
- databases
Research direction
Reproduce the selectors in Fauxton against a CouchDB 3.3.2 database with the described _id index and compare the behavior of $eq, $in, and $or. Trace Mango query planning and index selection to determine why the multi-value selectors do not complete; done means they use the available index and return the expected documents, with regression coverage.
Written by the indexing model from the issue text.
Description
My database has 4.7GB of data (3191269 docs)
Attribute _id has implicit index.
{
"type": "special",
"def": {
"fields": [
{
"_id": "asc"
}
]
}
}
This selector works well:
{
"selector": {
"_id": {
"$eq": "CustomerElastic_00001280-7a18-466b-9e9c-da5a2d903bda"
}
}
}
This selector is pending and never finished (the same when I use $or):
{
"selector": {
"_id": {
"$in": ["CustomerElastic_00000a29-329f-477f-8d4a-8244a9c738aa", "CustomerElastic_00001280-7a18-466b-9e9c-da5a2d903bda"]
}
}
}
Why?
Steps to Reproduce
Use fauxton and mango query.
Expected Behaviour
It should work the same as $eq
Your Environment
{"couchdb":"Welcome","version":"3.3.2","git_sha":"11a234070","uuid":"ff2fae1b3089d86fd741e84a6e532eda","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
- Browser name and version: Chrome latest version
- Operating system and version: Windows 11
- Dominant language
- Erlang
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 15
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/couchdb
-
bug needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/couchdb#6132 · 3 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
apache/couchdb#6120 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
apache/couchdb#6118 · 5 comments ·
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GoogleChromeLabs/project-sesame#216 ·
Maintainers usually reply within 12 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
check:passed logos:add
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day