Skip to content

sql: remove heuristic planner optimization passes#39766

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
RaduBerinde:rip-out-stuff-1
Aug 20, 2019
Merged

sql: remove heuristic planner optimization passes#39766
craig[bot] merged 2 commits intocockroachdb:masterfrom
RaduBerinde:rip-out-stuff-1

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

sql: don't use optimizePlan for scrub check

The physical scrub code uses optimizePlan simply to initialize the
span in a scanNode; do that directly instead.

Release note: None

sql: remove heuristic planner optimization passes

Removing the "optimization" part of the heuristic planner, and any
code that becomes unused.

We still keep the limit propagation pass; it will go away when the
optimizer has intelligence around soft limits.

A small fix that happened naturally is to propagate limits on
EXPLAIN which more accurately reflects the actual execution.

Release note: None

The physical scrub code uses optimizePlan simply to initialize the
span in a scanNode; do that directly instead.

Release note: None
@RaduBerinde RaduBerinde requested review from jordanlewis and knz August 20, 2019 14:47
@RaduBerinde RaduBerinde requested a review from a team as a code owner August 20, 2019 14:47
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@petermattis
Copy link
Copy Markdown
Collaborator

So much code deletion!!!

@knz
Copy link
Copy Markdown
Contributor

knz commented Aug 20, 2019

This is great. Next step is to remove planNode altogether!

(not reviewing in detail because I've lost touch of the specifics. But I'm 100% behind the change.)

@RaduBerinde
Copy link
Copy Markdown
Member Author

Thanks! Yeah, I started trying to rip out the planning part (makePlan) altogether but hit a few roadblocks and it was easier to start a bit smaller.

Copy link
Copy Markdown
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Wow this is the dream!!1

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis, @knz, and @RaduBerinde)


pkg/sql/scan.go, line 469 at r2 (raw file):

}

func isFilterTrue(expr tree.TypedExpr) bool {

nit: this feels random, any reason why it doesn't live next to its use in join_predicate?

Copy link
Copy Markdown
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Haha I didn't mean to put that sarcastic looking trailing 1 - only sincere happiness from me!

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

Removing the "optimization" part of the heuristic planner, and any
code that becomes unused.

We still keep the limit propagation pass; it will go away when the
optimizer has intelligence around soft limits.

A small fix that happened naturally is to propagate limits on
`EXPLAIN` which more accurately reflects the actual execution.

Release note: None
Copy link
Copy Markdown
Member Author

@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.

Haha, TFTR!

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


pkg/sql/scan.go, line 469 at r2 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

nit: this feels random, any reason why it doesn't live next to its use in join_predicate?

It's also used in this file. I believe the use in join_predicate will also go away soon. I moved it to opt_limits.go since it's used there more and the scanNode use is also related to limits.

@RaduBerinde
Copy link
Copy Markdown
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Aug 20, 2019
39766: sql: remove heuristic planner optimization passes r=RaduBerinde a=RaduBerinde

#### sql: don't use optimizePlan for scrub check

The physical scrub code uses optimizePlan simply to initialize the
span in a scanNode; do that directly instead.

Release note: None

#### sql: remove heuristic planner optimization passes

Removing the "optimization" part of the heuristic planner, and any
code that becomes unused.

We still keep the limit propagation pass; it will go away when the
optimizer has intelligence around soft limits.

A small fix that happened naturally is to propagate limits on
`EXPLAIN` which more accurately reflects the actual execution.

Release note: None


Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 20, 2019

Build succeeded

@craig craig bot merged commit b145ff1 into cockroachdb:master Aug 20, 2019
@RaduBerinde RaduBerinde deleted the rip-out-stuff-1 branch August 20, 2019 19:49
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.

5 participants