SQL Anti-Patterns
datamethods.substack.com
SQL Anti-Patterns
1–10 of 222 posts
Re: SQL Anti-Patterns
#2Re: SQL Anti-Patterns
#3Re: SQL Anti-Patterns
#4Is this code for 'use a lookup table' or am I falling behind on the terminology? The modern term should be 'sum table' or something similar surely.
Re: SQL Anti-Patterns
#5these aren’t anti patterns. these are just things you shouldn’t do
Re: SQL Anti-Patterns
#6Re: SQL Anti-Patterns
#7Why wouldn’t you store this information in a table and query it when you need it? What if you need to support other languages? With a table you can just add more columns for more languages!
Re: SQL Anti-Patterns
#8query WHERE name = ‘abc’
create an indexed UPPER(name) column"
Should there be an "or" between these 2 points, or am I missing something? Why create an UPPER index column and not use it?
Re: SQL Anti-Patterns
#9Unfortunately I learned this the hard way!
Re: SQL Anti-Patterns
#10The section of using functions on indexes could do with more explicit and deeper explanation. When you use the function on the index it becomes a full scan of the data instead as the query runner has to run the function on every row and column, effectively removing any benefit of the index. Unfortunately I learned this the hard way!