Skip to content

sql,colexec: minor cleanup of scan-related things#57267

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:cleanup
Dec 1, 2020
Merged

sql,colexec: minor cleanup of scan-related things#57267
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:cleanup

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

This commit removes multiple arguments in favor of using the spec when
initializing the cFetcher as well as refactors several loops in order to
avoid making copies of descriptors during table reader planning.

Additionally, it moves a map from scanNode next to the map's only user
(stats job) and removes the map from the scanNode itself as well as
removes some of the unused arguments.

Release note: None

@yuzefovich yuzefovich requested review from a team and jordanlewis December 1, 2020 00:28
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

offset := len(desc.Columns)
for i, col := range desc.MutationColumns() {
if col.ID == colID {
for i := range desc.MutationColumns() {
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.

extract desc.MutationColumns() outside of the loop, I don't think the compiler can necessarily eliminate the common subexpression here.

for _, col := range info.desc.MutationColumns() {
typs = append(typs, col.Type)
for i := range info.desc.MutationColumns() {
typs = append(typs, info.desc.MutationColumns()[i].Type)
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.

ditto above

for _, c := range info.desc.MutationColumns() {
descColumnIDs.Set(colID, int(c.ID))
for i := range info.desc.MutationColumns() {
descColumnIDs.Set(colID, int(info.desc.MutationColumns()[i].ID))
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.

ditto above

This commit removes multiple arguments in favor of using the spec when
initializing the cFetcher as well as refactors several loops in order to
avoid making copies of descriptors during table reader planning.

Additionally, it moves a map from scanNode next to the map's only user
(stats job) and removes the map from the scanNode itself as well as
removes some of the unused arguments.

Release note: None
Copy link
Copy Markdown
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.

TFTR!

bors r+

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


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

Previously, jordanlewis (Jordan Lewis) wrote…

extract desc.MutationColumns() outside of the loop, I don't think the compiler can necessarily eliminate the common subexpression here.

Done.


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

Previously, jordanlewis (Jordan Lewis) wrote…

ditto above

Done.


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

Previously, jordanlewis (Jordan Lewis) wrote…

ditto above

Done.

craig bot pushed a commit that referenced this pull request Dec 1, 2020
57267: sql,colexec: minor cleanup of scan-related things r=yuzefovich a=yuzefovich

This commit removes multiple arguments in favor of using the spec when
initializing the cFetcher as well as refactors several loops in order to
avoid making copies of descriptors during table reader planning.

Additionally, it moves a map from scanNode next to the map's only user
(stats job) and removes the map from the scanNode itself as well as
removes some of the unused arguments.

Release note: None

Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 1, 2020

Build failed:

@yuzefovich
Copy link
Copy Markdown
Member Author

Mysterious test failure with what-looks-like empty logs.

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 1, 2020

Build succeeded:

@craig craig bot merged commit 6980223 into cockroachdb:master Dec 1, 2020
@yuzefovich yuzefovich deleted the cleanup branch December 1, 2020 03:51
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