Please read the overview for important information on how to accelerate aggregate queries.
COUNT
tallies the number of matching rows/documents from the table.
Because COUNT(*)
does not specify any fields, you do not need to worry about passing a fast field to COUNT
if *
is used.
AVG
calculates the mean of the specified numeric field values across all documents.
SUM
computes the total sum of the specified numeric field values across all documents.
MIN
finds the smallest value for the specified numeric field across all documents.
MAX
finds the largest value for the specified numeric field across all documents.
COUNT(DISTINCT)
returns the number of unique values in a field. This is also known as a cardinality aggregation.
The following query creates buckets of size 1
for the rating
field. Each field value is rounded down to its bucket.
Expected Response
This query increases the bucket size to 2
.
Expected Response
While the above list of aggregates is non-exhaustive, the answer to any kind of aggregate in ParadeDB is to just write SQL. Any aggregate that can be expressed in SQL can be written in ParadeDB.