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

Interesting.

Some bones to pick: https://github.com/jarulraj/sqlcheck/blob/master/docs/query/...

First, dat implicit, inner join. Second, it could be written more clearly that, in this case, the reason you want to use a join is because you are not sure that the sub-query returns at most one row.




One good example is joining to a foreign data wrapper (FDW). Oftentimes, PostgreSQL can freak out about this because the statistics might be off/vague. So instead of making a small query to the FDW, it will do a full table scan :S

A subquery explicitly tells the database "hey, don't get the whole FDW, just this part that I want"


Can you please open an issue or send a PR to update the documentation? Thanks!


Yup sure thing!




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: