Skip to content

Optimize SELECT LIMIT SKIP query without ORDER BY #27

@arthurhsu

Description

@arthurhsu

Currently the LimitSkipByIndexPass will look for an existing IndexRangeScanStep in the execution tree

  • if it finds one, it will try to leverage it to perform limit/skip using the index
  • if it does not find one, it does nothing.

For this query, because there is no predicate, an IndexRangeScanStep does not exist in the tree, but instead of
concluding that the optimization is not applicable, we should check if the table has a primary key. If it does, then
use the primary key's index to perform LIMIT/SKIP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions