-
Notifications
You must be signed in to change notification settings - Fork 543
Description
Component(s)
database_observability.mysql
Add a description
When a query is executed with a WHERE clause which does not return a row, the resulting explain plan is empty.
For example select last_name from employees where emp_no = 1; will not return any rows and the resulting in a native explain plan that looks like this.
{
"query_block": {
"select_id": 1,
"message": "no matching row in const table"
}
}
The same query with an employee number that exists, I.E. select last_name from employees where emp_no = 10001; will produce a useful explain plan.
The QUERY_SAMPLE_TEXT in performance_schema.events_statements_summary_by_digest will contain the most recent concrete query that was executed for a given digest, possibly resulting in inconsistent explain plans, sometimes containing explain details or being empty as shown above.
We need to detect if the query sample will result in any returned rows, and not send an empty explain plan in that case.
Tip
React with 👍 if this issue is important to you.