mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix + Perf ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description This covers a few issues uncovered in customer investigations: 1) Explain doesn't show the new $not operators and instead uses $unknown 2) For streaming cursors we can't support parallel scans since that could reorder the tuples and make us miss results. If we have a streaming cursors - remove the parallel plan altogether 3) For non-streaming cursors, always prefer index paths over parallel seqscans - this is because our statistics aren't great and on large docs (esp with LIMIT) the selectivity makes the planner think a parallel path can be faster. We can re-evaluate this with statistics later 4) For non-streaming cursors with LIMIT, allow index scans instead of bitmap scans with a GUC. This also needs to be paired with the RUM enable_semifast_gettuple - this is behind a GUC to allow for validation of correctness. Outside of LIMIT scenarios do not allow this yet. Note: This is not yet enabled for TTL purger since we want to improve that case with an improvement inside amgettuple first.