Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: add explain format for optimizer trace #684

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ const (
RepeatableRead = "REPEATABLE-READ"

// Valid formats for explain statement.
ExplainFormatROW = "row"
ExplainFormatDOT = "dot"
ExplainFormatHint = "hint"
PumpType = "PUMP"
DrainerType = "DRAINER"
ExplainFormatROW = "row"
ExplainFormatDOT = "dot"
ExplainFormatHint = "hint"
ExplainFormatTrace = "opt_trace"
Copy link
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
Member

Choose a reason for hiding this comment

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

+1

PumpType = "PUMP"
DrainerType = "DRAINER"
)

// Transaction mode constants.
Expand All @@ -82,6 +83,7 @@ var (
ExplainFormatROW,
ExplainFormatDOT,
ExplainFormatHint,
ExplainFormatTrace,
}
)

Expand Down
1 change: 1 addition & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ var tokenMap = map[string]int{
"OPTIMIZE": optimize,
"OPTION": option,
"OPTIONALLY": optionally,
"OPT_TRACE": opttrace,
Copy link
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

"OR": or,
"ORDER": order,
"OUTER": outer,
Expand Down
Loading