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

Add history pk #12

Merged
merged 2 commits into from
Oct 7, 2023
Merged
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
6 changes: 4 additions & 2 deletions tpcc/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ CREATE TABLE IF NOT EXISTS history (
h_amount DECIMAL(6, 2),
h_data VARCHAR(24),
INDEX idx_h_w_id (h_w_id),
INDEX idx_h_c_w_id (h_c_w_id)
INDEX idx_h_c_w_id (h_c_w_id),
PRIMARY KEY(h_c_id, h_d_id, h_w_id, h_data)
)`

query = w.appendPartition(query, "h_w_id")
Expand Down Expand Up @@ -399,7 +400,8 @@ CREATE TABLE IF NOT EXISTS history (
h_w_id INT NOT NULL,
h_date TIMESTAMP,
h_amount DECIMAL(6, 2),
h_data VARCHAR(24)
h_data VARCHAR(24),
PRIMARY KEY(h_c_id, h_d_id, h_w_id, h_data)
)`
if err := w.createTableDDL(ctx, query, tableHistory); err != nil {
return err
Expand Down
Loading