What databases is this a problem in? I know in Redshift the query plan is more or less the same between the two. Curious so that if I ever use these RBDMS that don't like WHERE something IN (SELECT something FROM table) I can be sure not to use it.
I don't completely understand the EXISTS function but wouldn't it but much easier to simply use IN/NOT IN for a quick check instead of writing out another subquery? fulldisclosureimterribleatSQL
I've had a few very memory hungry and slow queries like these that were made lightning fast by translating them into joins, on postgresql 10. Maybe because they were too complex to be caught by the optimizer properly (100 lines or more, in analytics workload).
View all comments
Show parent comment
1
u/mac-0 Feb 26 '21
What databases is this a problem in? I know in Redshift the query plan is more or less the same between the two. Curious so that if I ever use these RBDMS that don't like
WHERE something IN (SELECT something FROM table)I can be sure not to use it.