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

tpcc: remove unused and unpartitionable stock_item_fk_idx #55638

Merged

Conversation

nvanbenschoten
Copy link
Member

This was discussed in #50911. We ended up not making the change because
it didn't appear to improve performance. Given the fact that the index
is only used in a single place and can easily be replaced by the primary
key of the stock table, it doesn't seem possible that this would
actually hurt performance. However, it does seem possible for the index
to hurt performance in multi-region clusters, where the fk validation
was not guaranteed to be local because it was not using the partitioned
primary key of the stock table.

This allows us to remove a scary comment around partitioning code,
because the index was not partitionable by warehouse id.

@nvanbenschoten nvanbenschoten requested review from aayushshah15 and a team October 16, 2020 18:20
@nvanbenschoten nvanbenschoten requested a review from a team as a code owner October 16, 2020 18:20
@nvanbenschoten nvanbenschoten requested review from dt and removed request for a team October 16, 2020 18:20
@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.

:lgtm:

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

This was discussed in cockroachdb#50911. We ended up not making the change because
it didn't appear to improve performance. Given the fact that the index
is only used in a single place and can easily be replaced by the primary
key of the stock table, it doesn't seem possible that this would
actually hurt performance. However, it does seem possible for the index
to hurt performance in multi-region clusters, where the fk validation
was not guaranteed to be local because it was not using the partitioned
primary key of the stock table.

This allows us to remove a scary comment around partitioning code,
because the index was not partitionable by warehouse id.
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/removeStockFK branch from 94fc818 to a0da596 Compare October 19, 2020 15:07
@nvanbenschoten
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 19, 2020

Build succeeded:

@craig craig bot merged commit e30dd43 into cockroachdb:master Oct 19, 2020
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/removeStockFK branch November 12, 2020 18:30
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