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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkg/ccl/importccl/read_import_avro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,8 @@ func benchmarkAvroImport(b *testing.B, avroOpts roachpb.AvroOptions, testData st
s_order_cnt integer,
s_remote_cnt integer,
s_data varchar(50),
primary key (s_w_id, s_i_id),
index stock_item_fk_idx (s_i_id))
`)
primary key (s_w_id, s_i_id)
)`)

require.NoError(b, err)

Expand Down
3 changes: 1 addition & 2 deletions pkg/sql/opt/bench/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ var schemas = [...]string{
s_order_cnt integer,
s_remote_cnt integer,
s_data varchar(50),
primary key (s_w_id, s_i_id),
index stock_item_fk_idx (s_i_id)
primary key (s_w_id, s_i_id)
)
`,
`
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/opt/testutils/opttester/testfixtures/tpcc_schema
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ CREATE TABLE stock
s_remote_cnt integer,
s_data varchar(50),
primary key (s_w_id, s_i_id),
index stock_item_fk_idx (s_i_id),
foreign key (s_w_id) references warehouse (w_id),
foreign key (s_i_id) references item (i_id)
) interleave in parent warehouse (s_w_id)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/xform/testdata/external/tpcc
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ insert order_line
│ │ └── cardinality: [6 - 6]
│ └── filters (true)
└── f-k-checks-item: order_line(ol_supply_w_id,ol_i_id) -> stock(s_w_id,s_i_id)
└── anti-join (lookup stock@stock_item_fk_idx)
└── anti-join (lookup stock)
├── columns: column6:35!null column5:36!null
├── key columns: [36 35] = [37 38]
├── key columns: [35 36] = [38 37]
├── lookup columns are key
├── cardinality: [0 - 6]
├── with-scan &1
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/xform/testdata/external/tpcc-later-stats
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ insert order_line
│ │ └── cardinality: [6 - 6]
│ └── filters (true)
└── f-k-checks-item: order_line(ol_supply_w_id,ol_i_id) -> stock(s_w_id,s_i_id)
└── anti-join (lookup stock@stock_item_fk_idx)
└── anti-join (lookup stock)
├── columns: column6:35!null column5:36!null
├── key columns: [36 35] = [37 38]
├── key columns: [35 36] = [38 37]
├── lookup columns are key
├── cardinality: [0 - 6]
├── with-scan &1
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/xform/testdata/external/tpcc-no-stats
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ insert order_line
│ │ └── cardinality: [6 - 6]
│ └── filters (true)
└── f-k-checks-item: order_line(ol_supply_w_id,ol_i_id) -> stock(s_w_id,s_i_id)
└── anti-join (lookup stock@stock_item_fk_idx)
└── anti-join (lookup stock)
├── columns: column6:35!null column5:36!null
├── key columns: [36 35] = [37 38]
├── key columns: [35 36] = [38 37]
├── lookup columns are key
├── cardinality: [0 - 6]
├── with-scan &1
Expand Down
2 changes: 1 addition & 1 deletion pkg/workload/tpcc/ddls.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const (
s_remote_cnt integer,
s_data varchar(50),
primary key (s_w_id, s_i_id)`
tpccStockSchemaFkSuffix = `
deprecatedTpccStockSchemaFkSuffix = `
index stock_item_fk_idx (s_i_id)`
tpccStockSchemaInterleaveSuffix = `
interleave in parent warehouse (s_w_id)`
Expand Down
3 changes: 0 additions & 3 deletions pkg/workload/tpcc/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,6 @@ func partitionOrderLine(db *gosql.DB, cfg zoneConfig, wPart *partitioner) error
}

func partitionStock(db *gosql.DB, cfg zoneConfig, wPart *partitioner) error {
// The stock_item_fk_idx can't be partitioned because it doesn't have a
// warehouse prefix. It's an all-around unfortunate index that we only
// need because of a restriction in SQL. See #36859 and #37255.
return partitionTable(db, cfg, wPart, "stock", "s_w_id", 0)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/workload/tpcc/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@ func (w *tpcc) Tables() []workload.Table {
Schema: maybeAddInterleaveSuffix(
w.interleaved,
maybeAddFkSuffix(
w.fks,
w.deprecatedFkIndexes,
tpccStockSchemaBase,
tpccStockSchemaFkSuffix,
deprecatedTpccStockSchemaFkSuffix,
),
tpccStockSchemaInterleaveSuffix,
),
Expand Down