-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: analyze where conditions to avoid full table scans in SELECT #1625
Comments
Mysql has condition pushdown and index condition pushdown optimization, these avoid reading full rows corresponding to all tuples that do not match the condition. |
@veteranlu The condition pushdown optimization is a bit different from what this issue is in reference to which is basic support for using indexes to avoid full table scans. I'll have to read those docs further, but it sounds similar to filtering functionality I'd like to add the basic KV |
The SQLite documentation on their query planner gives a decent overview of when indexes can be used: https://www.sqlite.org/queryplanner.html |
Processing of SELECT statements currently always performs a full table scan. We need to analyze the where condition to determine restrictions that allow for partial scans or individual row lookups. The analysis would look for restrictions on a prefix of the primary key (the only supported index at the moment). Retrieval of individual rows will also have to take into account the columns needed by the select expression.
The text was updated successfully, but these errors were encountered: