2 ms·
AFAIK, that's only a risk if you're using prepared statements. If you're just running each query individually, the parser should be smart and ignore the Boolea
by crazygringo 2y ago
AFAIK, that's only a risk if you're using prepared statements.
If you're just running each query individually, the parser should be smart and ignore the Boolean clauses that can be skipped, and use the appropriate indexes each time.
But yes, if you're trying to optimize performance with prepared statements, you almost certainly do not want to follow this approach if any of columns are indexed (which of course you will often want them to be).