pub struct QueryClassification {Show 25 fields
pub has_aggregation: bool,
pub has_window_functions: bool,
pub has_group_by: bool,
pub has_order_by: bool,
pub has_limit: bool,
pub has_offset: bool,
pub has_distinct: bool,
pub has_distinct_on: bool,
pub has_set_operations: bool,
pub has_having: bool,
pub is_select_star: bool,
pub select_has_scalar_subqueries: bool,
pub join_projection_dependencies: Option<Arc<Vec<Expression>>>,
pub has_joins: bool,
pub join_count: usize,
pub has_outer_joins: bool,
pub has_derived_tables: bool,
pub reorderable_join_count: usize,
pub has_where: bool,
pub where_has_parameters: bool,
pub where_has_subqueries: bool,
pub where_has_correlated_subqueries: bool,
pub has_nondeterministic_functions: bool,
pub select_has_correlated_subqueries: bool,
pub order_by_has_correlated_subqueries: bool,
/* private fields */
}Expand description
Pre-computed characteristics of a SELECT statement.
Fields§
§has_aggregation: boolWhether the query has aggregate functions (COUNT, SUM, etc.)
has_window_functions: boolWhether the query has window functions (ROW_NUMBER, etc.)
has_group_by: boolWhether the query has GROUP BY clause
has_order_by: boolWhether the query has ORDER BY clause
has_limit: boolWhether the query has LIMIT clause
has_offset: boolWhether the query has OFFSET clause
has_distinct: boolWhether the query has DISTINCT
has_distinct_on: boolWhether the query has DISTINCT ON (expr, …)
has_set_operations: boolWhether the query has set operations (UNION, etc.)
has_having: boolWhether the query has HAVING clause
is_select_star: boolWhether the SELECT is * (all columns)
select_has_scalar_subqueries: boolWhether SELECT has scalar subqueries
join_projection_dependencies: Option<Arc<Vec<Expression>>>Current-scope column references required after the JOIN tree. None
means that a star or nested query makes dependency projection unsafe.
has_joins: boolWhether the query has any joins
join_count: usizeNumber of JOIN edges in the complete table-expression tree.
has_outer_joins: boolWhether at least one JOIN edge is an outer-join reorder barrier.
has_derived_tables: boolWhether the table expression contains a derived/subquery boundary.
reorderable_join_count: usizeINNER equality edges that may participate in a reorder component.
has_where: boolWhether query has a WHERE clause
where_has_parameters: boolWhether WHERE clause has parameters ($1, $2, etc.)
where_has_subqueries: boolWhether WHERE clause has any subqueries
Whether WHERE has correlated subqueries (references outer columns)
has_nondeterministic_functions: boolWhether WHERE or SELECT has non-deterministic functions (NOW, RANDOM, UUID, etc.) that return different values per execution and must not be semantically cached
Whether any SELECT column has correlated subqueries
Whether ORDER BY has correlated subqueries
Implementations§
Source§impl QueryClassification
impl QueryClassification
Sourcepub fn classify(stmt: &SelectStatement) -> Self
pub fn classify(stmt: &SelectStatement) -> Self
Classify a SELECT statement, computing all characteristics in a single pass
Trait Implementations§
Source§impl Clone for QueryClassification
impl Clone for QueryClassification
Source§fn clone(&self) -> QueryClassification
fn clone(&self) -> QueryClassification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more