Suppress invalid column errors in vtexplain
#15272
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR suppresses unwanted
invalid column
errors invtexplain
.After changing the way we encode queries,
vtexplain
started showing these errors on routine executions:This repeated error causes
vtexplain
to significantly slow down. We get this error whenever the following query is executed:Previously, the above query evaluated to:
After the change, the query evaluates to:
and importantly, is now classified as a
SELECT
:vitess/go/vt/vtexplain/vtexplain_vttablet.go
Lines 577 to 583 in 54c6dfc
handleSelect
kicks off a series of steps, including inferring the column type, which isnull
after the change.This PR adds logic such that if we are in the special case of a
null
column type and the column name iscolumn_name
, do not log an error. Not logging an error reducesvtexplain
's runtime by several factors.This is a bug fix, and I think it should be backported.
Related Issue(s)
Fixes #15242
Checklist
Deployment Notes
N/A