Skip to content

sql: remove filter from scanNode#51493

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:no-filter-in-scan
Jul 16, 2020
Merged

sql: remove filter from scanNode#51493
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:no-filter-in-scan

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

Remove the filter from scanNode. It doesn't provide any benefit
anymore and it just causes confusion (e.g. soft limit handling). In
addition, we want EXPLAIN to map to exec.Factory calls as much as
possible; in this case we want the filter to be shown as a separate
node.

Release note (sql change): EXPLAIN (PLAN) now shows any filter on a
scan as a separate filter node.

@RaduBerinde RaduBerinde requested a review from yuzefovich July 16, 2020 00:38
@RaduBerinde RaduBerinde requested a review from a team as a code owner July 16, 2020 00:38
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@RaduBerinde RaduBerinde force-pushed the no-filter-in-scan branch 2 times, most recently from 948eef9 to 0cd44e9 Compare July 16, 2020 14:51
Copy link
Copy Markdown
Member

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

:lgtm:

Reviewed 34 of 34 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)


pkg/sql/distsql_physical_planner.go, line 471 at r1 (raw file):

		rec := canDistribute
		// Check if we are doing a full scan.
		if n.isFull {

I wonder whether we should change the recommendation of the scan distribution when performing partial scan, probably based on the estimated row count and some threshold setting, what do you think? I guess it is orthogonal to this PR, so just thinking out loud.

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.

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


pkg/sql/distsql_physical_planner.go, line 471 at r1 (raw file):

Previously, yuzefovich wrote…

I wonder whether we should change the recommendation of the scan distribution when performing partial scan, probably based on the estimated row count and some threshold setting, what do you think? I guess it is orthogonal to this PR, so just thinking out loud.

Yeah I'd expect it to be a threshold on the estimated row count

Remove the filter from scanNode. It doesn't provide any benefit
anymore and it just causes confusion (e.g. soft limit handling). In
addition, we want EXPLAIN to map to exec.Factory calls as much as
possible; in this case we want the filter to be shown as a separate
node.

Release note (sql change): EXPLAIN (PLAN) now shows any filter on a
scan as a separate `filter` node.
@RaduBerinde
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 16, 2020

Canceled (will resume)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 16, 2020

Build succeeded

@craig craig bot merged commit dc736e8 into cockroachdb:master Jul 16, 2020
@RaduBerinde RaduBerinde deleted the no-filter-in-scan branch July 18, 2020 14:53
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.

3 participants