Question Details

No question body available.

Tags

mysql

Answers (1)

February 4, 2026 Score: 0 Rep: 1 Quality: Low Completeness: 20%

Yes, your understanding is mostly correct.

In the first query, MySQL uses the index only for sorting (ORDER BY requesttime DESC), but it cannot apply the serialno and service_id filters using that index. So it scans many index entries backward and checks each row one by one until it finds enough matching rows, which makes it slow.

In the second query, MySQL scans the table sequentially, applies the WHERE conditions first, and then sorts only the filtered rows. Sequential scans plus a small sort can be faster than many random index lookups.

To see the real behavior, you can use:

EXPLAIN ANALYZE (shows actual rows examined and time)

Performance Schema (for rows and I/O metrics)