[ https://issues.apache.org/jira/browse/CASSANDRA-10765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15236889#comment-15236889 ]
Pavel Yaskevich commented on CASSANDRA-10765: --------------------------------------------- I'm planing to start working on this pretty soon so just to resurrect the discussion, here is the plan I have in mind: - since we rely heavily on ReadCommand and all interfaces are build around that I'm going try the least intrusive method - modify WhereClause (and maybe StatementRestrictions) to support OR and parenthesis between indexes and regular columns only so partition/clustering, if present, would still be required to always be separated by AND but I will try to make it so it's easy to change it as well if we ever handled to support multiple partitions fetched by single query (e.g. key = X OR key = Y). -- WhereClause is going to become a stack of relations separated by logical operators (AND, OR) in postfix notation (to support parenthesis); -- Partition/Clustering restrictions are going to remain "restriction lists" in StatementRestrictions; -- All other columns are going to be converted into QueryPlan which is going to return UnfilteredPartitionIterator; -- Instead of RowFilter ReadCommand is going to accept QueryPlan which will drive the query execution from ReadCommand#executeLocally. > add RangeIterator interface and QueryPlan for SI > ------------------------------------------------ > > Key: CASSANDRA-10765 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10765 > Project: Cassandra > Issue Type: Sub-task > Components: Local Write-Read Paths > Reporter: Pavel Yaskevich > Assignee: Pavel Yaskevich > Fix For: 3.x > > > Currently built-in indexes have only one way of handling > intersections/unions: pick the highest selectivity predicate and filter on > other index expressions. This is not always the most efficient approach. > Dynamic query planning based on the different index characteristics would be > more optimal. Query Plan should be able to choose how to do intersections, > unions based on the metadata provided by indexes (returned by RangeIterator) > and RangeIterator would became a base for cross index interactions and should > have information such as min/max token, estimate number of wrapped tokens etc. -- This message was sent by Atlassian JIRA (v6.3.4#6332)