mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-06 15:03:06 +00:00
cql3: Keep single column restrictions map inside statement restrictions
Some parts of the code make use of a map keeping single column restrictions for each partition key column. One of this places is inside do_filter, so it could be a performance problem to create such a map from scratch each time. After adding all restrictions from the where clause the new map is created and can be used for various purposes. Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>
This commit is contained in:
@@ -470,6 +470,9 @@ statement_restrictions::statement_restrictions(data_dictionary::database db,
|
||||
}
|
||||
}
|
||||
if (_where.has_value()) {
|
||||
if (!has_token(_new_partition_key_restrictions)) {
|
||||
_single_column_partition_key_restrictions = expr::get_single_column_restrictions_map(_new_partition_key_restrictions);
|
||||
}
|
||||
_clustering_prefix_restrictions = extract_clustering_prefix_restrictions(*_where, _schema);
|
||||
_partition_range_restrictions = extract_partition_range(*_where, _schema);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ private:
|
||||
|
||||
expr::expression _new_partition_key_restrictions;
|
||||
|
||||
expr::single_column_restrictions_map _single_column_partition_key_restrictions;
|
||||
|
||||
/**
|
||||
* Restrictions on clustering columns
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user