4 ms·
Something I don't see in the pgdog documentation is how cross-shard joins work. Okay, if I do a simple `select * from users order by id`, you'll in-memory order
by eximius 2y ago
Something I don't see in the pgdog documentation is how cross-shard joins work. Okay, if I do a simple `select * from users order by id`, you'll in-memory order the combined results for me. But if I have group by and aggregations and such? Will it resolve that correctly?
- levkk 2y agoAggregates are a work in progress. We're going to implement them in this order: 1. count 2. max, min, sum 3. avg (needs a query rewrite to include count) Eventually, we'll do all of these: https://www.postgresql.org/docs/current/functions-aggregate.html https://www.postgresql.org/docs/current/functions-aggregate..... If you got a specific use case, reach out and we'll prioritize.
- eximius 2y agoHeh, no chance I can introduce this at work and hard to have a personal project requiring it. :) I think you probably need some documentation to the effect of the current state of affairs, as well as prescriptions as to how to work around it. _Most_ live workloads, even if the total dataset is huge, have a pretty small working set. So limiting DB operations to simple fetches and doing any complex operations in memory is viable, but should be prescribed as the solution or people will consider it's omission as a fault instead of a choice.
- levkk 2y agoNo worries. It's early days, the code and docs are just a few months in the making. I'm happy to keep you updated on the progress. If you want, send your contact info to hi@pgdog.dev. - Lev
- levkk 2y agoI ended up adding support for GROUP BY: https://github.com/pgdogdev/pgdog/pull/43 https://github.com/pgdogdev/pgdog/pull/43 I had it in the back of my mind for a while, nice to have it in code. Works pretty well, as long as columns in GROUP BY are present in the result set. Otherwise, we would need to rewrite the query to include them, and remove them once we're done.