SQL table with “list” entry vs SQL table with a row for each entry

Where my queries look for a pairing of value, %b% using LIKE. Is it
more efficient in terms of query time to instead have a table where
each row is a permutation:

Most definitely. Because LIKE ‘%something%’ type queries cannot use indexes. So you look ups are going to be very slow. If that’s not enough you are using pretty much an RDBMS anti pattern. more details here: Is storing a delimited list in a database column really that bad?

once you break up your ‘CSV’ column into separate columns, you can take it still further by normalizing the database.

Leave a Comment