Can GROUP BY still be optimized after all these years? (pivotlake.io)
SkiFire13 5 hours ago
malisper an hour ago
SELECT item_id, COUNT(*) AS c
FROM orders
GROUP BY item_id
ORDER BY c DESC
LIMIT 10;
They are getting the top 10 most frequent values of item_id. It's possible for one item_id to be the 11th most popular item across every partition and not the 10th. Then when you sum the counts across all partitions, it becomes the 10th most common.malisper 10 hours ago
ozgrakkurt 11 hours ago
https://benchmark.clickhouse.com/#system=+liH|Hoaus|DcD|ucqs...
holoduke 7 hours ago
misiek08 8 hours ago
Can't we really keep the IT without breaking news/we are all gonna die/sensationalist way of passing news?
d1sxeyes 7 hours ago
It’s not sensationalist, it’s just a bit sloppy with the word “faster”.
Sesse__ 7 hours ago
[1] Even latency changes are best described in terms of throughput.
_zoltan_ 6 hours ago
seritools 3 hours ago
shikck200 10 hours ago
Sesse__ 8 hours ago
toddbandrowsky 14 hours ago
The fastest possible group by is in sequential memory on that box, fetched from an nvme.
So, when we do group by partitioning, we're really saying, put the groups themselves on different boxes, and group the group by. If it were some utter megaset, the place to put it is on a mainframe, which is basically created for purposes of group by on ridiculous datasets.
asdf88990 13 hours ago
ozgrakkurt 11 hours ago
Measurements and context is so situational that it would be useless anyway imo.
It is not like any DB company is writing blog posts with benchmarks compared to hardware limits. DuckDB had blog posts that has sentences like "You are doing it wrong if you are not using HTTP api on your database in 2026", last time I saw their blog.
I also think object storage is bad in this case. And rust is no a no-no for a database project like this, because it is not ergonomic to do static allocation and arena allocators in rust. And parquet is trash for performance because of many reasons like supported compression formats etc.
eru 10 hours ago
I'm not sure ergonomics matter that much these days, when your agent can write the tedious bits?
sagarm 10 hours ago
However horizontal scaling has advantages in that it's easier to scale up and down incrementally. It gives you more aggregate network bandwidth for accessing disaggregated data. Disaggregation allows for independent scaling of compute and storage. Losing a single machine has a marginal impact on the cluster, which can enable you to use cheaper spot resources.
Basically, it's often easier to operate a system designed around horizontal scaling if you need resiliency.