Skip to content

sql: display postqueries in EXPLAIN #38849

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

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

yuzefovich
Copy link
Member

Postqueries are now displayed in the output of EXPLAIN statement.

Fixes: #38340.

Release note: None

@yuzefovich yuzefovich requested review from jordanlewis, RaduBerinde and a team July 12, 2019 17:17
@yuzefovich yuzefovich requested a review from a team as a code owner July 12, 2019 17:17
@yuzefovich yuzefovich requested review from a team July 12, 2019 17:17
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Thanks for this!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis, @RaduBerinde, and @yuzefovich)


pkg/sql/logictest/testdata/planner_test/postquery, line 1 at r1 (raw file):

# LogicTest: local-opt fakedist-opt

This is great, except this should live in opt/execbuilder/testdata (everything in planner_test is non-opt). Can you also rename it to fk_opt? To correspond with the fk_opt file in logictests.


pkg/sql/logictest/testdata/planner_test/postquery, line 13 at r1 (raw file):


statement ok
INSERT INTO parent VALUES (1), (2)

[nit] remove this (data doesn't matter when we're just explaining)

@yuzefovich yuzefovich force-pushed the explain-postqueries branch from 13295ae to 42cc321 Compare July 12, 2019 20:30
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @RaduBerinde)


pkg/sql/logictest/testdata/planner_test/postquery, line 1 at r1 (raw file):

Previously, RaduBerinde wrote…

This is great, except this should live in opt/execbuilder/testdata (everything in planner_test is non-opt). Can you also rename it to fk_opt? To correspond with the fk_opt file in logictests.

Done.


pkg/sql/logictest/testdata/planner_test/postquery, line 13 at r1 (raw file):

Previously, RaduBerinde wrote…

[nit] remove this (data doesn't matter when we're just explaining)

Indeed, done.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @yuzefovich)


pkg/sql/explain_plan.go, line 368 at r2 (raw file):

			return err
		}
		observer.attr("postquery", "id", fmt.Sprintf("@S%d", i+1))

[nit] I don't think this id is useful in the output. I will (after this PR merges) add a field to the node with a "description" of the postquery, (e.g. FK-check-<fk-name>).


pkg/sql/opt/exec/execbuilder/testdata/fk_opt, line 1 at r2 (raw file):

# LogicTest: local-opt fakedist-opt

remove fakedist-opt (local vs fakedist makes no difference in these tests where we just EXPLAIN)

Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @RaduBerinde)


pkg/sql/explain_plan.go, line 368 at r2 (raw file):

Previously, RaduBerinde wrote…

[nit] I don't think this id is useful in the output. I will (after this PR merges) add a field to the node with a "description" of the postquery, (e.g. FK-check-<fk-name>).

Yeah, I was also thinking it's not useful. Removed.


pkg/sql/opt/exec/execbuilder/testdata/fk_opt, line 1 at r2 (raw file):

Previously, RaduBerinde wrote…

remove fakedist-opt (local vs fakedist makes no difference in these tests where we just EXPLAIN)

Done.

@yuzefovich yuzefovich force-pushed the explain-postqueries branch from 42cc321 to 89f261b Compare July 14, 2019 20:02
Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)

Postqueries are now displayed in the output of EXPLAIN statement.

Release note: None
@yuzefovich yuzefovich force-pushed the explain-postqueries branch from 89f261b to 19bc3ac Compare July 15, 2019 04:29
@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 15, 2019

Build failed

@yuzefovich
Copy link
Member Author

Seems like a flake.

bors r+

craig bot pushed a commit that referenced this pull request Jul 15, 2019
38849: sql: display postqueries in EXPLAIN r=yuzefovich a=yuzefovich

Postqueries are now displayed in the output of EXPLAIN statement.

Fixes: #38340.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jul 15, 2019

Build succeeded

@craig craig bot merged commit 19bc3ac into cockroachdb:master Jul 15, 2019
@yuzefovich yuzefovich deleted the explain-postqueries branch July 19, 2019 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: display postqueries in EXPLAIN
3 participants