Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 执行计划的阅读
An execution plan is shown above. I would like to ask how to understand the “range:[200,200], [300,300], (400 ‘2024-02-01’,400 ‘2024-05-01’]” here?
Constructed predicate condition range
Your OR condition is just multiple intervals, and within the OR, the equality interval exam and the end are the same.
Matches your WHERE condition.
The corresponding OR filter in the query
The bolded conditions are: where (id=200 and lname=‘sylar’) or (id=300 and lname=‘john’) or (id=400 and lname=‘foller’) and hired>‘2024-02-01’ and hired<=‘2024-05-01’;
The reason why there is no lname-related content is because
table: employees, index: idx_id_hired_store(id, hired, store_id)
The idx_id_hired_store index under the employees table does not contain the lname field.
Therefore, lname-related filtering is handled in the subsequent selection operator.