This week, I learned about using NOT EXISTS in a SQL subquery! I was able to use this to get rid of a left join and speed up a hairy database query 🎉🎉🎉 It really made my week lol. Also had a really good chat with a mentee about equivalence vs. equality in JS and Ruby!
It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
I wish SQL had a negative join operation consistent with other join types because the fact that a NOT EXISTS subquery outperforms the outer join + null test approach just doesn't seem right.
This week, I learned about using NOT EXISTS in a SQL subquery! I was able to use this to get rid of a left join and speed up a hairy database query 🎉🎉🎉 It really made my week lol. Also had a really good chat with a mentee about equivalence vs. equality in JS and Ruby!
I wish SQL had a negative join operation consistent with other join types because the fact that a
NOT EXISTS
subquery outperforms the outer join + null test approach just doesn't seem right.I absolutely agree - I actually found this by googling "opposite of a join query" 😂 it would be cool to have an EXCLUDE operation or something similar