News for hackers. Stuff that matters.
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by therealwardo on Thursday August 03, 2023 @01:05PM (#36988584)
how does Hydra compare to Citus? https://www.citusdata.com
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by jerrysievert on Thursday August 03, 2023 @01:08PM (#36988628)
generally faster across the board, a lot of work was done to expand and speed it up, plus updates, deletes, and vacuuming.

https://benchmark.clickhouse.com/#eyJzeXN0ZW0iOnsiQXRoZW5hIC...

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by adr1an on Thursday August 03, 2023 @01:32PM (#36988994)
Right when I was thinking URL shorteners were out of fashion... /S
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by biugbkifcjk on Thursday August 03, 2023 @02:15PM (#36989596)
It's just there to make it easier for mobile users to click it..
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by setr on Thursday August 03, 2023 @03:41PM (#36990749)
I don’t see why the GitHub link is any harder to click than the tiny url link in that post.

I’m pretty sure the only reason url shorteners exist with purpose is because of Twitter limits (and software that doesn’t visually hide egregiously long urls), but continues to be used outside of those places due to cargo culting

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by rubiquity on Thursday August 03, 2023 @02:05PM (#36989458)
Since benchmarks can be misleading I want to point out that the differences between Hydra and the "tuned"[0] PostgreSQL (which are some very basic settings) are a lot less convincing, with plain old PG coming ahead on quite a few: https://tinyurl.com/eju9tht2

I also noticed quite a bit of parity between Hydra and Citus on data set size. Is Hydra a fork of Citus columnar storage?

0 - https://github.com/ClickHouse/ClickBench/blob/main/postgresq...

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by arp242 on Thursday August 03, 2023 @02:13PM (#36989566)
> plain old PG coming ahead on quite a few

I found that is common among these types of databases (e.g. Citus, Timescale, etc.) which perform well under very specific conditions, and worse for many (most?) other things, sometimes significantly worse.

That said, Hydra does take up ~17.5G for that benchmark and "PostgreSQL tuned" about 120G, the insert time is ~9 times faster, and "cold run" is quite a bit faster too. It's only "hot run" that shows a fairly small difference. I think it's fair to say Hydra "wins" that benchmark.

> Is Hydra a fork of Citus columnar storage?

Yes: "Hydra Columnar is a fork from Citus Columnar c. April, 2022".

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @03:46PM (#36990804)
> Hydra does take up ~17.5G for that benchmark and "PostgreSQL tuned" about 120G

you can run pg on compressed filesystem

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by arp242 on Thursday August 03, 2023 @04:12PM (#36991130)
I'm sure you can, but AFAIK neither uses compression in that benchmark so it's a fair comparison. Even if filesystem compression would reduce that to 17.5G (doubtable), it won't be free in terms of CPU cycles, and no matter what it's still ~120G to load in memory, bytes to scan/update, etc.
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @04:22PM (#36991271)
my bet is that hydra uses compression inside already, otherwise it is hard to explain where difference comes from.

> it won't be free in terms of CPU cycles

it can reduce IO traffic significantly, and it can be very positive trade off depending on circumstances.

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by arp242 on Thursday August 03, 2023 @04:42PM (#36991539)
I had assumed that PostgreSQL is so much larger because it creates heaps of indexes (which is probably also why inserts are so much slower for it), but I don't really have a good way to confirm that quickly.
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @04:44PM (#36991577)
one can choose to not create "heaps of indexes".
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by arp242 on Thursday August 03, 2023 @05:07PM (#36991936)
At which point your performance will drop like a brick for these types of queries – I'm pretty sure these indexes weren't added for the craic.
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @05:14PM (#36992039)
it depends on your query obviously.

In general, I did very deep benchmarking of pg, clickhouse and duckdb, and I sure didn't make stupid mistakes like this: https://news.ycombinator.com/item?id=36990831

My dataset has 50B rows and 2tb of data, and I think columnar dbs are very overhiped and I chose pg because:

- pg performance is acceptable, maybe 2-5x times slower than clickhouse and duckdb on some queries if pg is configured correctly and run on compressed storage

- clickhouse and duckdb start falling apart very fast because they specialized on very narrow type of queries: https://github.com/ClickHouse/ClickHouse/issues/47520 https://github.com/ClickHouse/ClickHouse/issues/47521 https://github.com/duckdb/duckdb/discussions/6696

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by zX41ZdbW on Thursday August 03, 2023 @05:23PM (#36992152)
ClickHouse can do large GROUP BY queries, not limited by memory: https://clickhouse.com/docs/en/sql-reference/statements/sele...
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @05:25PM (#36992186)
as explained in https://github.com/ClickHouse/ClickHouse/issues/47521#issuec... it can't, that parameters only applies on pre aggregation phase but not aggregation.

Feature request is not implemented yet: https://github.com/ClickHouse/ClickHouse/issues/40588

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by zX41ZdbW on Friday August 04, 2023 @07:47AM (#36998595)
ClickHouse uses "grace hash" GROUP BY with the number of buckets = 256.

It can do size about 256 times larger than a memory because only one bucket has to be in memory while merging. It works for distributed query processing as well and is enabled by default.

About the linked issue - it looks like it is related to some extra optimization on top of what already exists.

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Friday August 04, 2023 @01:02PM (#37002701)
> only one bucket has to be in memory while merging.

its hard for me to judge about implementation details, but per that person reply memory is also multiplied by number of threads which do aggregation.

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by benn0 on Thursday August 03, 2023 @06:45PM (#36993117)
Do you have happen to have any documentation about your benchmarking? I'm also considering these options at the moment (currently using pg+timescaledb) and interested in what you found.
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @07:38PM (#36993539)
I don't have documentation.

I just created large tables, and tried to join, group by, sort them in pg, clickhouse, duckdb, looked what failed or being slow, and tried to resolve it.

I am happy to answer specific questions, but I didn't use timescaledb.

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by arp242 on Friday August 04, 2023 @04:54AM (#36997291)
"2-5x times slower" can mean the difference from 2 seconds to 4 to 10 seconds. Two seconds is still (barely) acceptable for interactive usage, ten seconds: not so much. You're also going to need less beefy servers, or fewer servers.

I also "just" use PostgreSQL for all of this by the way, but the limitations are pretty obvious. You're much more limited in what you can query with good performance, unless you start creating tons of queries or pre-computed data and such, which have their own trade-offs. Columnar DBs are "overhyped" in the sense that everything in programming seems to be, but they do exist for good reasons (the reason I don't use it are because they also come with their own set of downsides, as well as just plain laziness).

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Thursday August 03, 2023 @03:48PM (#36990831)
> 0 - https://github.com/ClickHouse/ClickBench/blob/main/postgresq...

that postgres config is very underpowered, it has only 8 workers per gather while machine has 192 vcpus.

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by re-thc on Friday August 04, 2023 @12:54AM (#36995630)
Submit a PR?
Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Friday August 04, 2023 @12:38PM (#37002365)
this is the task of complexity to have someone with paid job to work on it.

I can implement it (I implemented this algo for my own framework), but I expect lots of hustle to go through code review.

Re:Show HN: Hydra 1.0 – open-source column-oriented Postgres by riku_iki on Friday August 04, 2023 @12:58PM (#37002643)
I am not sure what is the process, who will rerun benchmarks then?