-
Notifications
You must be signed in to change notification settings - Fork 333
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
Transforms some filters into range scans #2807
Comments
Is there a more detailed description or issue to facilitate participation and contribution? |
There are some steps
We can try to extract ranges from filters in the table predicate as the first step. Each range bound could be a |
I thought it might be appropriate that the range bound should be something like a structure like this?
Tips: I found that |
A bound might contain multiple columns if we have a compound key. So a bound could be: struct Bound {
values: Vec<Value>,
inclusive: bool,
} If we encode values by memcomparable encoding, we could also reuse the bound struct here. But I'm not sure whether it is a good idea. greptimedb/src/index/src/inverted_index/search/predicate.rs Lines 40 to 47 in d4a54a0
Yes. Note that the Reference |
Recently I read some articles about index selection, and I found a rule:
So I'm wondering if I can use something like Case 1: There is an index with three columns Case 2: There are two indexes with one column Tips: Case 2 can use similar ref: |
Yes, it is possible. Note that we should support both |
Yes, the order should not lead to inconsistent results I'll try to verify the correctness of this |
What type of enhancement is this?
Performance
What does the enhancement do?
Converts query conditions into primary key ranges to scan.
Here is an example from TiDB's docs: https://docs.pingcap.com/tidb/stable/explain-indexes#indexlookup
Implementation challenges
We might perform the transformation in the query optimizers.
The storage engine can reduce the key range to scan or rows to return. We can implement range scan in the mito engine.
The text was updated successfully, but these errors were encountered: