Tag - subquery

When the subselect runs faster

A few weeks ago, we had a query optimization request from one of our customer.
The query was very simple like:

Shell

SELECT * FROM `table` WHERE (col1=’A’||col1=’B’) ORDER BY id DESC LIMIT 20 OFFSET 0

1

SELECT * FROM `table` WHERE (col1=’A’||col1=’B’) ORDER BY id DESC LIMIT 20 OFFSET 0

This column in the table is looks like this:

Shell

`col1` […]

Read more