You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying a collection, the default index on _id is used even though there are other more suitable indexes available. Checked on pouchdb directly and the same query does use another index there.
After a little research, noticed that if no sorting is requested, the default is to sort by _id, which seems to enforce the use of the default index.
When explicitly sorting by another field, a better index is used. Same if I remove the line which forces the sort on _id
Info
Environment: Node.js
Code
To reproduce, set env var DEBUG to "pouchdb:find"
First query does not use the index on passportId
Second query does use the index on passportId
Case
Bug
Issue
When querying a collection, the default index on
_id
is used even though there are other more suitable indexes available. Checked on pouchdb directly and the same query does use another index there.After a little research, noticed that if no sorting is requested, the default is to sort by
_id
, which seems to enforce the use of the default index.When explicitly sorting by another field, a better index is used. Same if I remove the line which forces the sort on
_id
Info
Code
To reproduce, set env var
DEBUG
to "pouchdb:find"First query does not use the index on passportId
Second query does use the index on passportId
First query


Second query
The text was updated successfully, but these errors were encountered: