2 ms·
> for aggregates with variable-length per-group state, we don't have a good size estimate Can you say a bit more why?
by life_is_short 10y ago
> for aggregates with variable-length per-group state, we don't have a good size estimate
Can you say a bit more why?
- pgaddict 10y agoNo one implemented a better solution ;-) Jokes aside, it seems simple but is fairly tricky, as it depends both on input data and various other parameters. For example for array_agg() or string_agg() it might be estimated from number of entries / average length. For hll it also depends on the accuracy and expected number of values to track, etc. I was considering adding another method to the API, providing a better estimate, but never got to that. So the current code simply assumes 1KB (IIRC) per group in those cases, or something like that. Of course, the memory estimate also depends on the number of groups, but that's an orthogonal issue.