Sha256: 7abfa787146f0644d7a60d6230b3d79ab4109a30d3eb8bec0b80b09fd9165142

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

.TH Summarize
.PP
Aggregate and compute
.SH Signature
.PP
.RS
.nf
summarize(operand: Relation, by: AttrList, aggs: Summarization) -> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
summarize(supplies, [:sid], total: sum(:qty))
.fi
.RE
.PP
.RS
.nf
summarize(supplies, [:sid], total: sum{|t| t.qty * 2 })
.fi
.RE
.PP
.RS
.nf
summarize(supplies, [:pid, :qty], {total: sum{|t| t.qty * 2 }}, allbut: true)
.fi
.RE
.SH Description
.PP
Computes the relation obtained by taking the projection of \fB\fCoperand\fR
on \fB\fCby\fR attributes then extending each tuple \fB\fCt\fR with the result of
aggregations defined by \fB\fCaggs\fR on the tuples from \fB\fCoperand\fR matching \fB\fCt\fR\&.
.PP
In SQL terms, \fB\fCSELECT [by], [agg] FROM operand GROUP BY [by]\fR\&.
.SH Implementation notes
.PP
As of current Alf version, this operator cannot be translated to SQL code.
That means that all computations are done in ruby, which may seriously
hurt performance.
.PP
Similarly, as \fB\fCsummarize\fR tends to be a showstopper during compilation, it
is strongly recommanded to use it as high as possible in query expressions
trees so as to delegate the largest possible query parts to data engines.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-shell-0.15.0 doc/man/summarize.man