[−][src]Struct postgres_parser::sys::GroupingFunc
GroupingFunc
A GroupingFunc is a GROUPING(...) expression, which behaves in many ways like an aggregate function (e.g. it "belongs" to a specific query level, which might not be the one immediately containing it), but also differs in an important respect: it never evaluates its arguments, they merely designate expressions from the GROUP BY clause of the query level to which it belongs.
The spec defines the evaluation of GROUPING() purely by syntactic replacement, but we make it a real expression for optimization purposes so that one Agg node can handle multiple grouping sets at once. Evaluating the result only needs the column positions to check against the grouping set being projected. However, for EXPLAIN to produce meaningful output, we have to keep the original expressions around, since expression deparse does not give us any feasible way to get at the GROUP BY clause.
Also, we treat two GroupingFunc nodes as equal if they have equal arguments lists and agglevelsup, without comparing the refs and cols annotations.
In raw parse output we have only the args list; parse analysis fills in the refs list, and the planner fills in the cols list.
Fields
xpr: Expr
args: *mut List
refs: *mut List
arguments, not evaluated but kept for benefit of EXPLAIN etc.
cols: *mut List
ressortgrouprefs of arguments
agglevelsup: Index
actual column positions set by planner
location: c_int
same as Aggref.agglevelsup
Trait Implementations
impl Debug for GroupingFunc
[src]
impl Default for GroupingFunc
[src]
impl Eq for GroupingFunc
[src]
impl Hash for GroupingFunc
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<GroupingFunc> for GroupingFunc
[src]
fn eq(&self, other: &GroupingFunc) -> bool
[src]
fn ne(&self, other: &GroupingFunc) -> bool
[src]
impl StructuralEq for GroupingFunc
[src]
impl StructuralPartialEq for GroupingFunc
[src]
Auto Trait Implementations
impl RefUnwindSafe for GroupingFunc
impl !Send for GroupingFunc
impl !Sync for GroupingFunc
impl Unpin for GroupingFunc
impl UnwindSafe for GroupingFunc
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,