Skip to main content

QueryClassification

Struct QueryClassification 

Source
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: bool

Whether the query has aggregate functions (COUNT, SUM, etc.)

§has_window_functions: bool

Whether the query has window functions (ROW_NUMBER, etc.)

§has_group_by: bool

Whether the query has GROUP BY clause

§has_order_by: bool

Whether the query has ORDER BY clause

§has_limit: bool

Whether the query has LIMIT clause

§has_offset: bool

Whether the query has OFFSET clause

§has_distinct: bool

Whether the query has DISTINCT

§has_distinct_on: bool

Whether the query has DISTINCT ON (expr, …)

§has_set_operations: bool

Whether the query has set operations (UNION, etc.)

§has_having: bool

Whether the query has HAVING clause

§is_select_star: bool

Whether the SELECT is * (all columns)

§select_has_scalar_subqueries: bool

Whether 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: bool

Whether the query has any joins

§join_count: usize

Number of JOIN edges in the complete table-expression tree.

§has_outer_joins: bool

Whether at least one JOIN edge is an outer-join reorder barrier.

§has_derived_tables: bool

Whether the table expression contains a derived/subquery boundary.

§reorderable_join_count: usize

INNER equality edges that may participate in a reorder component.

§has_where: bool

Whether query has a WHERE clause

§where_has_parameters: bool

Whether WHERE clause has parameters ($1, $2, etc.)

§where_has_subqueries: bool

Whether WHERE clause has any subqueries

§where_has_correlated_subqueries: bool

Whether WHERE has correlated subqueries (references outer columns)

§has_nondeterministic_functions: bool

Whether WHERE or SELECT has non-deterministic functions (NOW, RANDOM, UUID, etc.) that return different values per execution and must not be semantically cached

§select_has_correlated_subqueries: bool

Whether any SELECT column has correlated subqueries

§order_by_has_correlated_subqueries: bool

Whether ORDER BY has correlated subqueries

Implementations§

Source§

impl QueryClassification

Source

pub fn classify(stmt: &SelectStatement) -> Self

Classify a SELECT statement, computing all characteristics in a single pass

Trait Implementations§

Source§

impl Clone for QueryClassification

Source§

fn clone(&self) -> QueryClassification

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueryClassification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for QueryClassification

Source§

fn eq(&self, other: &QueryClassification) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for QueryClassification

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompactArcDrop for T

Source§

unsafe fn drop_and_dealloc(ptr: *mut u8)

Drop the contained data and deallocate the header+data allocation. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V