Skip to content

Does creating Index for the fields which are used in the partial_filter_selector improves query performance? #3099

Answered by willholley
raji94 asked this question in Q&A
Discussion options

You must be logged in to vote

When using json indexes, $in operators cannot be used to narrow the range of the index scan.

The query planner only supports a single range scan of an index when fulfilling a query - it's essentially querying a view with a startkey/endkey parameter. You can see the generated view query if you call the _explain endpoint (or "explain" button in the UI).

Since a single range cannot be inferred from the $in operator in conjunction with other clauses, this filter is applied in memory against each row returned from the index.

If you need more flexibility, you can install clouseau and use text index types.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@raji94
Comment options

@willholley
Comment options

@raji94
Comment options

@willholley
Comment options

@raji94
Comment options

Answer selected by raji94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants