Hacker News new | past | comments | ask | show | jobs | submit login

It just means PostgreSQL can choose the wrong one for a specific instance, not that those are universally wrong.

"PostgreSQL chosing a suboptimal join methods (a 'join method' is Nested Join, Hash Join, Merge Join, etc., each of which is optimized for a specific situation) leads to unnecessarily high resource consumption.

"[And unlike virtually every other DBMS, PostgreSQL doesn't support specifying which method is used for a particular join. So even if it happen relatively infrequently, it's very difficult to correct a situation where it does choose the wrong one.]"




> PostgreSQL doesn't support specifying which method is used for a particular join

Not directly, no. You can make some of them possible / impossible depending on your indexing and server settings, as well as the query itself. For example, if the smaller side of the join can't fix into `work_mem` – which defaults to 4 MiB – you won't get a hash join. You can either create smaller tables, more restrictive join conditions, or increase the size of `work_mem` (but be careful not to blow up the DB, since that's per connection).


And you can use the enable_* sledgehammers as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: