Skip to content

parser: add explain format for optimizer trace - #684

Open
winoros wants to merge 6 commits into
masterfrom
yiding/opt-trace
Open

parser: add explain format for optimizer trace#684
winoros wants to merge 6 commits into
masterfrom
yiding/opt-trace

Conversation

@winoros

Copy link
Copy Markdown
Member

What problem does this PR solve?

Add one more new explain format to enable optimizer trace.

Check List

Tests

  • Unit test

@winoros
winoros requested a review from a teamDecember 16, 2019 12:02
@ghost
ghost requested review from tangenta and removed request for a teamDecember 16, 2019 12:02
Comment threadparser.y Outdated
@codecov

codecovBot commented Dec 17, 2019

Copy link
Copy Markdown

Codecov Report

Merging #684 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #684 +/- ##
==========================================
+ Coverage 79.82% 79.82% +<.01% 
==========================================
Files 37 37 Lines 13625 13635 +10 ==========================================
+ Hits 10876 10884 +8 - Misses 2103 2105 +2 
Partials 646 646
Impacted FilesCoverage Δ
parser.go93.13% <ø> (-0.03%)⬇️
ast/misc.go76.14% <ø> (ø)⬆️
misc.go93.49% <ø> (ø)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f7cc23...de9e9f4. Read the comment docs.

@tangentatangenta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment threadmisc.go
"OPTIMIZE": optimize,
"OPTION": option,
"OPTIONALLY": optionally,
"OPT_TRACE": opttrace,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that we don't need it? Check https://github.com/pingcap/parser/pull/654/files

Comment threadast/misc.go
ExplainFormatROW = "row"
ExplainFormatDOT = "dot"
ExplainFormatHint = "hint"
ExplainFormatTrace = "opt_trace"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply trace is enough?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment threadparser.y
Format: "row",
}
startOffset := parser.startOffset(&yyS[yypt])
$2.SetText(string(parser.src[startOffset:]))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give an example to explain the purpose of these 2 lines?

Comment threadparser.y
startOffset := parser.startOffset(&yyS[yypt])
$5.SetText(string(parser.src[startOffset:]))
}
| ExplainSym "FORMAT" "=" ExplainFormatType "FOR" "CONNECTION" NUM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot get the optimizer trace from explain for connection since the plan may have already been generated?

@ti-chi-bot

Copy link
Copy Markdown
Member

@winoros: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov-commenter

codecov-commenter commented Oct 15, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.82%. Comparing base (0f7cc23) to head (de9e9f4).
⚠️ Report is 361 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #684 +/- ##
=======================================
Coverage 79.82% 79.82% =======================================
Files 37 37 Lines 13625 13635 +10 =======================================
+ Hits 10876 10884 +8 - Misses 2103 2105 +2 
Partials 646 646 
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@winoros@ti-chi-bot@codecov-commenter@zz-jason@eurekaka@alivxxx@tangenta