GROUP BYqueries) to make sure that the server doesn't run out of memory.
<numGroupsLimit>groups per segment. This value is set to 100,000 by default and can be configured by the
numGroupsLimitReachedproperty will be set to
truein the query response if the value is reached.
ORDER BYclause used in the query.
max(<minSegmentGroupTrimSize>, 5 * LIMIT)groups if it gets more groups. Pinot keeps at least
5 * LIMITgroups when trimming tail groups to ensure the accuracy of results.
max(<minServerGroupTrimSize>, 5 * LIMIT)groups if it gets more groups.
<minServerGroupTrimSize>is set to 5,000 by default and can be adjusted by configuring the
pinot.server.query.executor.min.server.group.trim.sizeproperty. When setting the configuration to
-1, the cross segments trim can be disabled.
LIMITof 10 if one isn't defined and this applies to
GROUP BYqueries as well. Therefore, if no limit is specified, Pinot will return 10 groups.
ORDER BYclause to reduce the memory footprint and improve the query performance. It keeps at least
5 * LIMITgroups so that the results give good enough approximation in most cases. The configurable min trim size can be used to increase the groups kept to improve the accuracy but has a larger extra memory footprint.
HAVINGclause, it is applied on the merged
GROUP BYresults that already have the tail groups trimmed. If the
HAVINGclause is the opposite of the
ORDER BYorder, groups matching the condition might already be trimmed and not returned. e.g.