News for hackers. Stuff that matters.
Re:Using Redundant Conditions to Unlock Indexes in MySQL by mdpye on Wednesday June 07, 2023 @02:10PM (#36230863)
I haven't checked if this works in mysql, but in postgres I would certainly reach for an index on the computed values, which it supports.

Index the thing you're querying on...

Re:Using Redundant Conditions to Unlock Indexes in MySQL by aarondf on Wednesday June 07, 2023 @02:19PM (#36231021)
Totally agree! From the article:

> The optimal indexing strategy always depends on the application, but in general, it's best to have indexes on the conditions you are frequently querying against. [...] This makes redundant conditions useful for queries that are only sometimes run or where indexes can't be easily added to the main conditions.

Re:Using Redundant Conditions to Unlock Indexes in MySQL by berkle4455 on Wednesday June 07, 2023 @02:18PM (#36231004)
MySQL 8+ also supports functional indexes