Skip to content

opt: don't create unnecessary FK indexes in testcat#51879

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:test-cat-fk-idx
Jul 25, 2020
Merged

opt: don't create unnecessary FK indexes in testcat#51879
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:test-cat-fk-idx

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

We no longer create FK indexes on the referencing side; this commit
updates the test catalog accordingly.

We also adjust the tpcc schema to remove the indexes that we decided
are unnecessary and removed from our fixtures.

Release note: None

We no longer create FK indexes on the referencing side; this commit
updates the test catalog accordingly.

We also adjust the tpcc schema to remove the indexes that we decided
are unnecessary and removed from our fixtures.

Release note: None
@RaduBerinde RaduBerinde requested a review from rohany July 24, 2020 16:33
@RaduBerinde RaduBerinde requested a review from a team as a code owner July 24, 2020 16:33
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@RaduBerinde
Copy link
Copy Markdown
Member Author

@andy-kimball can you take a look at the change to trading and see if we want to add that index explicitly?

@nvanbenschoten do you have any info on how TPCE runs on master if you try to create the schema from scratch (and thus don't get the auto FK indexes)? I see quite a few plan changes in our test file, but this is only a test with no table stats so it may not be too relevant.

@andy-kimball
Copy link
Copy Markdown
Contributor


pkg/sql/opt/xform/testdata/external/trading, line 1117 at r1 (raw file):

 │         │    │    │    ├── key: (8-10)
 │         │    │    │    ├── fd: (8-10)-->(11)
 │         │    │    │    ├── scan inventorydetails

This is a substantially worse plan for this query, but I think that's OK. It looks like we'd need to implement #51576 in order to get a better plan without adding an index.

@RaduBerinde
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 25, 2020

Build succeeded:

@craig craig bot merged commit 979f4ad into cockroachdb:master Jul 25, 2020
@nvb
Copy link
Copy Markdown
Contributor

nvb commented Jul 27, 2020

do you have any info on how TPCE runs on master if you try to create the schema from scratch (and thus don't get the auto FK indexes)? I see quite a few plan changes in our test file, but this is only a test with no table stats so it may not be too relevant.

I don't right now. There have been a good number of changes to TPC-E's schema and queries since they were pulled into these tests, so we'll want to update them once things settle down. In the meantime, I'll be on the lookout for auto fk indexes that were actually important next time I spin up the workload.

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