4 ms·
Interesting. Some bones to pick: https://github.com/jarulraj/sqlcheck/blob/master/docs/query/3013.md https://github.com/jarulraj/sqlcheck/blob/master/docs/quer
by snake_plissken 9y ago
Interesting.
Some bones to pick: https://github.com/jarulraj/sqlcheck/blob/master/docs/query/3013.md 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.
- temuze 9y agoOne 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"
- jarulraj 9y agoCan you please open an issue or send a PR to update the documentation? Thanks!
- snake_plissken 9y agoYup sure thing!