From 7235f11f83ac9339d2b0ada9c5c80bfc6b0eee92 Mon Sep 17 00:00:00 2001 From: Shantanu Gupta Date: Mon, 15 Jul 2024 14:58:58 +0530 Subject: [PATCH 1/2] Add new microbenchmarks for On Conflict, Update improvments, Select for update --- .../postgres/CW1_on_conflict_do_nothing.yaml | 240 +++++++++++++++ .../postgres/CW2_on_conflict_do_update.yaml | 272 +++++++++++++++++ .../postgres/CW3_select_for_update.yaml | 87 ++++++ .../CW1_on_conflict_do_nothing.yaml | 242 ++++++++++++++++ .../CW2_on_conflict_do_update.yaml | 274 ++++++++++++++++++ .../yb_colocated/CW3_select_for_update.yaml | 89 ++++++ .../yugabyte/CW1_on_conflict_do_nothing.yaml | 241 +++++++++++++++ .../yugabyte/CW2_on_conflict_do_update.yaml | 273 +++++++++++++++++ .../yugabyte/CW3_select_for_update.yaml | 88 ++++++ .../updateG4_unmodified_set_clause.yaml | 191 ++++++++++++ .../updateG4_unmodified_set_clause.yaml | 193 ++++++++++++ .../updateG4_unmodified_set_clause.yaml | 192 ++++++++++++ 12 files changed, 2382 insertions(+) create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW1_on_conflict_do_nothing.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW2_on_conflict_do_update.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW3_select_for_update.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW1_on_conflict_do_nothing.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW2_on_conflict_do_update.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW3_select_for_update.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW1_on_conflict_do_nothing.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW2_on_conflict_do_update.yaml create mode 100644 config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW3_select_for_update.yaml create mode 100644 config/yugabyte/regression_pipelines/write_workloads/postgres/updateG4_unmodified_set_clause.yaml create mode 100644 config/yugabyte/regression_pipelines/write_workloads/yb_colocated/updateG4_unmodified_set_clause.yaml create mode 100644 config/yugabyte/regression_pipelines/write_workloads/yugabyte/updateG4_unmodified_set_clause.yaml diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW1_on_conflict_do_nothing.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW1_on_conflict_do_nothing.yaml new file mode 100644 index 000000000..543542016 --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW1_on_conflict_do_nothing.yaml @@ -0,0 +1,240 @@ +type: POSTGRES +driver: org.postgresql.Driver +url: jdbc:postgresql://{{endpoint}}:5432/postgres?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1, user_id_1, bal_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + + loadRules: + - table: accounts_ + count: 1 + rows: 1000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 1000000, 2 ] + + executeRules: + - workload: CW1_1_2column_condition_no_conflict_so_single_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 1000001, 5000000 ] + - util: PrimaryIntGen + params: [ 1000001, 5000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1000001, 5000000, 2 ] + + + - workload: CW1_2_4column_condition_no_conflict_so_single_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 5000001, 10000000 ] + - util: PrimaryIntGen + params: [ 5000001, 10000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 5000001, 10000000, 2 ] + + - workload: CW1_3_2column_condition_no_conflict_so_10_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 10000000, 15000000 ] + - util: PrimaryIntGen + params: [ 10000000, 15000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 10000000, 15000000, 2 ] + + - workload: CW1_4_4column_condition_no_conflict_so_10_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 15000000, 20000000 ] + - util: PrimaryIntGen + params: [ 15000000, 20000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 15000000, 20000000, 2 ] + + - workload: CW1_5_2column_condition_no_conflict_so_10_insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 20000001, 25000000 ] + - util: PrimaryIntGen + params: [ 20000001, 25000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 20000001, 25000000, 2 ] + + - workload: CW1_6_4column_condition_no_conflict_so_10_insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 25000001, 30000000 ] + - util: PrimaryIntGen + params: [ 25000001, 30000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 25000001, 30000000, 2 ] + + - workload: CW1_7_2column_condition_no_conflict_so_10values_in_1insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 30000001, 35000000 ] + - util: PrimaryIntGen + params: [ 30000001, 35000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 30000001, 35000000, 2 ] + - util: PrimaryIntGen + params: [ 35000001, 40000000 ] + - util: PrimaryIntGen + params: [ 35000001, 40000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 35000001, 40000000, 2 ] + - util: PrimaryIntGen + params: [ 40000001, 45000000 ] + - util: PrimaryIntGen + params: [ 40000001, 45000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 40000001, 45000000, 2 ] + - util: PrimaryIntGen + params: [ 45000001, 50000000 ] + - util: PrimaryIntGen + params: [ 45000001, 50000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 45000001, 50000000, 2 ] + - util: PrimaryIntGen + params: [ 50000001, 55000000 ] + - util: PrimaryIntGen + params: [ 50000001, 55000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 50000001, 55000000, 2 ] + - util: PrimaryIntGen + params: [ 55000001, 60000000 ] + - util: PrimaryIntGen + params: [ 55000001, 60000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 55000001, 60000000, 2 ] + - util: PrimaryIntGen + params: [ 60000001, 65000000 ] + - util: PrimaryIntGen + params: [ 60000001, 65000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 60000001, 65000000, 2 ] + - util: PrimaryIntGen + params: [ 65000001, 70000000 ] + - util: PrimaryIntGen + params: [ 65000001, 70000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 65000001, 70000000, 2 ] + - util: PrimaryIntGen + params: [ 70000001, 75000000 ] + - util: PrimaryIntGen + params: [ 70000001, 75000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 70000001, 75000000, 2 ] + - util: PrimaryIntGen + params: [ 75000001, 80000000 ] + - util: PrimaryIntGen + params: [ 75000001, 80000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 75000001, 80000000, 2 ] + + diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW2_on_conflict_do_update.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW2_on_conflict_do_update.yaml new file mode 100644 index 000000000..207b462b2 --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW2_on_conflict_do_update.yaml @@ -0,0 +1,272 @@ +type: POSTGRES +driver: org.postgresql.Driver +url: jdbc:postgresql://{{endpoint}}:5432/postgres?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1, user_id_1, bal_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + + loadRules: + - table: accounts_ + count: 1 + rows: 6000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 6000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 6000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + + executeRules: + - workload: CW1_1_2column_condition_single_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 1000000, 2 ] + + + - workload: CW1_2_4column_condition_single_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1000000, 2000000 ] + - util: PrimaryIntGen + params: [ 1000000, 2000000 ] + - util: PrimaryStringGen + params: [ 1000000, 50 ] + - util: PrimaryFloatGen + params: [ 1000000, 2000000, 2 ] + + - workload: CW1_3_2column_condition_10_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 2000000, 3000000 ] + - util: PrimaryIntGen + params: [ 2000000, 3000000 ] + - util: PrimaryStringGen + params: [ 2000000, 50 ] + - util: PrimaryFloatGen + params: [ 2000000, 3000000, 2 ] + + - workload: CW1_4_4column_condition_10_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 3000000, 4000000 ] + - util: PrimaryIntGen + params: [ 3000000, 4000000 ] + - util: PrimaryStringGen + params: [ 3000000, 50 ] + - util: PrimaryFloatGen + params: [ 3000000, 4000000, 2 ] + + - workload: CW1_5_2column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 4000000, 5000000 ] + - util: PrimaryIntGen + params: [ 4000000, 5000000 ] + - util: PrimaryStringGen + params: [ 4000000, 50 ] + - util: PrimaryFloatGen + params: [ 4000000, 5000000, 2 ] + + - workload: CW1_6_4column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] + + - workload: CW1_7_2column_condition_10values_in_1upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + + - workload: CW1_8_2column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET bal_1=accounts_1.bal_1+1 RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] + + - workload: CW1_9_2column_condition_10_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET bal_1=accounts_1.bal_1+1 RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW3_select_for_update.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW3_select_for_update.yaml new file mode 100644 index 000000000..726a24eb3 --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/postgres/CW3_select_for_update.yaml @@ -0,0 +1,87 @@ +type: POSTGRES +driver: org.postgresql.Driver +url: jdbc:postgresql://{{endpoint}}:5432/postgres?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - DROP TABLE IF EXISTS accounts_2; + - CREATE TABLE IF NOT EXISTS accounts_2(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_2( user_id_1, account_id_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + - DROP TABLE IF EXISTS accounts_2; + + loadRules: + - table: accounts_ + count: 2 + rows: 2000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 2000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 2000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 2000000, 2 ] + + executeRules: + - workload: CW3_1_select_baseline + run: + - name: statement1_insert + weight: 100 + queries: + - query: SELECT bal_1 FROM accounts_1 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] + + - workload: CW3_2_update_baseline + run: + - name: statement1_insert + weight: 100 + queries: + - query: UPDATE accounts_1 SET bal_1=bal_1+1 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') returning bal_1 + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] + + - workload: CW3_3_select_for_update + run: + - name: statement1_insert + weight: 100 + queries: + - query: SELECT bal_1 FROM accounts_2 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') for update + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] \ No newline at end of file diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW1_on_conflict_do_nothing.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW1_on_conflict_do_nothing.yaml new file mode 100644 index 000000000..29d4dd991 --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW1_on_conflict_do_nothing.yaml @@ -0,0 +1,242 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false +createdb: drop database if exists yb_colocated; create database yb_colocated with colocated=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1, user_id_1, bal_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + + loadRules: + - table: accounts_ + count: 1 + rows: 1000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 1000000, 2 ] + + executeRules: + - workload: CW1_1_2column_condition_no_conflict_so_single_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 1000001, 5000000 ] + - util: PrimaryIntGen + params: [ 1000001, 5000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1000001, 5000000, 2 ] + + + - workload: CW1_2_4column_condition_no_conflict_so_single_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 5000001, 10000000 ] + - util: PrimaryIntGen + params: [ 5000001, 10000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 5000001, 10000000, 2 ] + + - workload: CW1_3_2column_condition_no_conflict_so_10_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 10000000, 15000000 ] + - util: PrimaryIntGen + params: [ 10000000, 15000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 10000000, 15000000, 2 ] + + - workload: CW1_4_4column_condition_no_conflict_so_10_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 15000000, 20000000 ] + - util: PrimaryIntGen + params: [ 15000000, 20000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 15000000, 20000000, 2 ] + + - workload: CW1_5_2column_condition_no_conflict_so_10_insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 20000001, 25000000 ] + - util: PrimaryIntGen + params: [ 20000001, 25000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 20000001, 25000000, 2 ] + + - workload: CW1_6_4column_condition_no_conflict_so_10_insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 25000001, 30000000 ] + - util: PrimaryIntGen + params: [ 25000001, 30000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 25000001, 30000000, 2 ] + + - workload: CW1_7_2column_condition_no_conflict_so_10values_in_1insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 30000001, 35000000 ] + - util: PrimaryIntGen + params: [ 30000001, 35000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 30000001, 35000000, 2 ] + - util: PrimaryIntGen + params: [ 35000001, 40000000 ] + - util: PrimaryIntGen + params: [ 35000001, 40000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 35000001, 40000000, 2 ] + - util: PrimaryIntGen + params: [ 40000001, 45000000 ] + - util: PrimaryIntGen + params: [ 40000001, 45000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 40000001, 45000000, 2 ] + - util: PrimaryIntGen + params: [ 45000001, 50000000 ] + - util: PrimaryIntGen + params: [ 45000001, 50000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 45000001, 50000000, 2 ] + - util: PrimaryIntGen + params: [ 50000001, 55000000 ] + - util: PrimaryIntGen + params: [ 50000001, 55000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 50000001, 55000000, 2 ] + - util: PrimaryIntGen + params: [ 55000001, 60000000 ] + - util: PrimaryIntGen + params: [ 55000001, 60000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 55000001, 60000000, 2 ] + - util: PrimaryIntGen + params: [ 60000001, 65000000 ] + - util: PrimaryIntGen + params: [ 60000001, 65000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 60000001, 65000000, 2 ] + - util: PrimaryIntGen + params: [ 65000001, 70000000 ] + - util: PrimaryIntGen + params: [ 65000001, 70000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 65000001, 70000000, 2 ] + - util: PrimaryIntGen + params: [ 70000001, 75000000 ] + - util: PrimaryIntGen + params: [ 70000001, 75000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 70000001, 75000000, 2 ] + - util: PrimaryIntGen + params: [ 75000001, 80000000 ] + - util: PrimaryIntGen + params: [ 75000001, 80000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 75000001, 80000000, 2 ] + + diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW2_on_conflict_do_update.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW2_on_conflict_do_update.yaml new file mode 100644 index 000000000..3f2f0b005 --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW2_on_conflict_do_update.yaml @@ -0,0 +1,274 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false +createdb: drop database if exists yb_colocated; create database yb_colocated with colocated=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1, user_id_1, bal_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + + loadRules: + - table: accounts_ + count: 1 + rows: 6000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 6000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 6000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + + executeRules: + - workload: CW1_1_2column_condition_single_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 1000000, 2 ] + + + - workload: CW1_2_4column_condition_single_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1000000, 2000000 ] + - util: PrimaryIntGen + params: [ 1000000, 2000000 ] + - util: PrimaryStringGen + params: [ 1000000, 50 ] + - util: PrimaryFloatGen + params: [ 1000000, 2000000, 2 ] + + - workload: CW1_3_2column_condition_10_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 2000000, 3000000 ] + - util: PrimaryIntGen + params: [ 2000000, 3000000 ] + - util: PrimaryStringGen + params: [ 2000000, 50 ] + - util: PrimaryFloatGen + params: [ 2000000, 3000000, 2 ] + + - workload: CW1_4_4column_condition_10_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 3000000, 4000000 ] + - util: PrimaryIntGen + params: [ 3000000, 4000000 ] + - util: PrimaryStringGen + params: [ 3000000, 50 ] + - util: PrimaryFloatGen + params: [ 3000000, 4000000, 2 ] + + - workload: CW1_5_2column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 4000000, 5000000 ] + - util: PrimaryIntGen + params: [ 4000000, 5000000 ] + - util: PrimaryStringGen + params: [ 4000000, 50 ] + - util: PrimaryFloatGen + params: [ 4000000, 5000000, 2 ] + + - workload: CW1_6_4column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] + + - workload: CW1_7_2column_condition_10values_in_1upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + + - workload: CW1_8_2column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET bal_1=accounts_1.bal_1+1 RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] + + - workload: CW1_9_2column_condition_10_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET bal_1=accounts_1.bal_1+1 RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW3_select_for_update.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW3_select_for_update.yaml new file mode 100644 index 000000000..61facf20e --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/yb_colocated/CW3_select_for_update.yaml @@ -0,0 +1,89 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false +createdb: drop database if exists yb_colocated; create database yb_colocated with colocated=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - DROP TABLE IF EXISTS accounts_2; + - CREATE TABLE IF NOT EXISTS accounts_2(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_2( user_id_1, account_id_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + - DROP TABLE IF EXISTS accounts_2; + + loadRules: + - table: accounts_ + count: 2 + rows: 2000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 2000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 2000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 2000000, 2 ] + + executeRules: + - workload: CW3_1_select_baseline + run: + - name: statement1_insert + weight: 100 + queries: + - query: SELECT bal_1 FROM accounts_1 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] + + - workload: CW3_2_update_baseline + run: + - name: statement1_insert + weight: 100 + queries: + - query: UPDATE accounts_1 SET bal_1=bal_1+1 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') returning bal_1 + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] + + - workload: CW3_3_select_for_update + run: + - name: statement1_insert + weight: 100 + queries: + - query: SELECT bal_1 FROM accounts_2 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') for update + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] \ No newline at end of file diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW1_on_conflict_do_nothing.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW1_on_conflict_do_nothing.yaml new file mode 100644 index 000000000..3650e6aff --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW1_on_conflict_do_nothing.yaml @@ -0,0 +1,241 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1, user_id_1, bal_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + + loadRules: + - table: accounts_ + count: 1 + rows: 1000000 + columns: + - name: account_id_ + count: 1INSERT INTO a + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 1000000, 2 ] + + executeRules: + - workload: CW1_1_2column_condition_no_conflict_so_single_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 1000001, 5000000 ] + - util: PrimaryIntGen + params: [ 1000001, 5000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1000001, 5000000, 2 ] + + + - workload: CW1_2_4column_condition_no_conflict_so_single_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 5000001, 10000000 ] + - util: PrimaryIntGen + params: [ 5000001, 10000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 5000001, 10000000, 2 ] + + - workload: CW1_3_2column_condition_no_conflict_so_10_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 10000000, 15000000 ] + - util: PrimaryIntGen + params: [ 10000000, 15000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 10000000, 15000000, 2 ] + + - workload: CW1_4_4column_condition_no_conflict_so_10_insert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 15000000, 20000000 ] + - util: PrimaryIntGen + params: [ 15000000, 20000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 15000000, 20000000, 2 ] + + - workload: CW1_5_2column_condition_no_conflict_so_10_insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 20000001, 25000000 ] + - util: PrimaryIntGen + params: [ 20000001, 25000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 20000001, 25000000, 2 ] + + - workload: CW1_6_4column_condition_no_conflict_so_10_insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO NOTHING RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 25000001, 30000000 ] + - util: PrimaryIntGen + params: [ 25000001, 30000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 25000001, 30000000, 2 ] + + - workload: CW1_7_2column_condition_no_conflict_so_10values_in_1insert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO NOTHING + bindings: + - util: PrimaryIntGen + params: [ 30000001, 35000000 ] + - util: PrimaryIntGen + params: [ 30000001, 35000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 30000001, 35000000, 2 ] + - util: PrimaryIntGen + params: [ 35000001, 40000000 ] + - util: PrimaryIntGen + params: [ 35000001, 40000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 35000001, 40000000, 2 ] + - util: PrimaryIntGen + params: [ 40000001, 45000000 ] + - util: PrimaryIntGen + params: [ 40000001, 45000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 40000001, 45000000, 2 ] + - util: PrimaryIntGen + params: [ 45000001, 50000000 ] + - util: PrimaryIntGen + params: [ 45000001, 50000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 45000001, 50000000, 2 ] + - util: PrimaryIntGen + params: [ 50000001, 55000000 ] + - util: PrimaryIntGen + params: [ 50000001, 55000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 50000001, 55000000, 2 ] + - util: PrimaryIntGen + params: [ 55000001, 60000000 ] + - util: PrimaryIntGen + params: [ 55000001, 60000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 55000001, 60000000, 2 ] + - util: PrimaryIntGen + params: [ 60000001, 65000000 ] + - util: PrimaryIntGen + params: [ 60000001, 65000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 60000001, 65000000, 2 ] + - util: PrimaryIntGen + params: [ 65000001, 70000000 ] + - util: PrimaryIntGen + params: [ 65000001, 70000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 65000001, 70000000, 2 ] + - util: PrimaryIntGen + params: [ 70000001, 75000000 ] + - util: PrimaryIntGen + params: [ 70000001, 75000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 70000001, 75000000, 2 ] + - util: PrimaryIntGen + params: [ 75000001, 80000000 ] + - util: PrimaryIntGen + params: [ 75000001, 80000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 75000001, 80000000, 2 ] + + diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW2_on_conflict_do_update.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW2_on_conflict_do_update.yaml new file mode 100644 index 000000000..1811cd17b --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW2_on_conflict_do_update.yaml @@ -0,0 +1,273 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1, user_id_1, bal_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + + loadRules: + - table: accounts_ + count: 1 + rows: 6000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 6000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 6000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + + executeRules: + - workload: CW1_1_2column_condition_single_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 1000000, 2 ] + + + - workload: CW1_2_4column_condition_single_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1000000, 2000000 ] + - util: PrimaryIntGen + params: [ 1000000, 2000000 ] + - util: PrimaryStringGen + params: [ 1000000, 50 ] + - util: PrimaryFloatGen + params: [ 1000000, 2000000, 2 ] + + - workload: CW1_3_2column_condition_10_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 2000000, 3000000 ] + - util: PrimaryIntGen + params: [ 2000000, 3000000 ] + - util: PrimaryStringGen + params: [ 2000000, 50 ] + - util: PrimaryFloatGen + params: [ 2000000, 3000000, 2 ] + + - workload: CW1_4_4column_condition_10_upsert + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 3000000, 4000000 ] + - util: PrimaryIntGen + params: [ 3000000, 4000000 ] + - util: PrimaryStringGen + params: [ 3000000, 50 ] + - util: PrimaryFloatGen + params: [ 3000000, 4000000, 2 ] + + - workload: CW1_5_2column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 4000000, 5000000 ] + - util: PrimaryIntGen + params: [ 4000000, 5000000 ] + - util: PrimaryStringGen + params: [ 4000000, 50 ] + - util: PrimaryFloatGen + params: [ 4000000, 5000000, 2 ] + + - workload: CW1_6_4column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1, user_id_1, bal_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] + + - workload: CW1_7_2column_condition_10values_in_1upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET (account_id_1,user_id_1,addr_1,bal_1)=(excluded.account_id_1,excluded.user_id_1,excluded.addr_1,excluded.bal_1) + bindings: + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryIntGen + params: [ 1, 6000000 ] + - util: PrimaryStringGen + params: [ 1, 50 ] + - util: PrimaryFloatGen + params: [ 1, 6000000, 2 ] + + - workload: CW1_8_2column_condition_1_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET bal_1=accounts_1.bal_1+1 RETURNING * + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] + + - workload: CW1_9_2column_condition_10_upsert_with_returning + run: + - name: statement1_insert + weight: 100 + queries: + - query: INSERT INTO accounts_1(account_id_1,user_id_1,addr_1,bal_1) VALUES (?,?,?,?) ON CONFLICT (user_id_1, account_id_1) DO UPDATE SET bal_1=accounts_1.bal_1+1 RETURNING * + count: 10 + bindings: + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryIntGen + params: [ 5000000, 6000000 ] + - util: PrimaryStringGen + params: [ 5000000, 50 ] + - util: PrimaryFloatGen + params: [ 5000000, 6000000, 2 ] diff --git a/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW3_select_for_update.yaml b/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW3_select_for_update.yaml new file mode 100644 index 000000000..d1ef8070b --- /dev/null +++ b/config/yugabyte/regression_pipelines/conditional_workloads/yugabyte/CW3_select_for_update.yaml @@ -0,0 +1,88 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 1 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +yaml_version: v1.0 +works: + work: + time_secs: 180 + rate: unlimited + warmup: 60 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: true + create: + - DROP TABLE IF EXISTS accounts_1; + - CREATE TABLE IF NOT EXISTS accounts_1(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_1( user_id_1, account_id_1); + - DROP TABLE IF EXISTS accounts_2; + - CREATE TABLE IF NOT EXISTS accounts_2(account_id_1 bigint, user_id_1 bigint, addr_1 varchar(50), bal_1 float(2),PRIMARY KEY(account_id_1)); + - CREATE UNIQUE INDEX user_accounts ON accounts_2( user_id_1, account_id_1); + + cleanup: + - DROP TABLE IF EXISTS accounts_1; + - DROP TABLE IF EXISTS accounts_2; + + loadRules: + - table: accounts_ + count: 2 + rows: 2000000 + columns: + - name: account_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 2000000 ] + - name: user_id_ + count: 1 + util: PrimaryIntGen + params: [ 1, 2000000 ] + - name: addr_ + count: 1 + util: PrimaryStringGen + params: [ 1, 50 ] + - name: bal_ + count: 1 + util: PrimaryFloatGen + params: [ 1, 2000000, 2 ] + + executeRules: + - workload: CW3_1_select_baseline + run: + - name: statement1_insert + weight: 100 + queries: + - query: SELECT bal_1 FROM accounts_1 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] + + - workload: CW3_2_update_baseline + run: + - name: statement1_insert + weight: 100 + queries: + - query: UPDATE accounts_1 SET bal_1=bal_1+1 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') returning bal_1 + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] + + - workload: CW3_3_select_for_update + run: + - name: statement1_insert + weight: 100 + queries: + - query: SELECT bal_1 FROM accounts_2 WHERE account_id_1=ANY('{?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}') for update + bindings: + - util: RandomNumber + count: 50 + params: [ 1, 2000000 ] \ No newline at end of file diff --git a/config/yugabyte/regression_pipelines/write_workloads/postgres/updateG4_unmodified_set_clause.yaml b/config/yugabyte/regression_pipelines/write_workloads/postgres/updateG4_unmodified_set_clause.yaml new file mode 100644 index 000000000..4de9b62fa --- /dev/null +++ b/config/yugabyte/regression_pipelines/write_workloads/postgres/updateG4_unmodified_set_clause.yaml @@ -0,0 +1,191 @@ +type: postgres +driver: org.postgresql.Driver +url: jdbc:postgresql://{{endpoint}}:5432/postgres?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 4 +terminals: 1 +collect_pg_stat_statements: true +works: + work: + time_secs: 60 + rate: unlimited + warmup: 30 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: false + create: + - DROP TABLE IF EXISTS pkeyBigint1M_1; + - DROP TABLE IF EXISTS pkeyBigint1M_child_1; + - CREATE TABLE pkeyBigint1M_1(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1)); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card1_1); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card2_1 ASC) INCLUDE (col_bigint_id_2); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card3_1 DESC); + - CREATE UNIQUE INDEX ON pkeyBigint1M_1(col_bigint_id_3); + - CREATE TABLE pkeyBigint1M_child_1(col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_varchar10_id_1 varchar(10), col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, PRIMARY KEY(col_bigint_id_1)); + - ALTER TABLE pkeyBigint1M_child_1 ADD CONSTRAINT pkeyBigint1M_child_id1_fk FOREIGN KEY (col_bigint_id_2) REFERENCES pkeyBigint1M_1 (col_bigint_id_1); + - ALTER TABLE pkeyBigint1M_child_1 ADD CONSTRAINT pkeyBigint1M_child_id1_fk FOREIGN KEY (col_bigint_id_3) REFERENCES pkeyBigint1M_1 (col_bigint_id_3); + - CREATE INDEX ON pkeyBigint1M_child_1(col_bigint_card1_1); + + cleanup: + - DROP TABLE IF EXISTS pkeyBigint1M_1; + - DROP TABLE IF EXISTS pkeyBigint1M_child_1; + + loadRules: + - table: pkeyBigint1M_ + count: 1 + rows: 1000000 + columns: + - name: col_bigint_card1_ + count: 1 + util: OneNumberFromArray + params: [ 1000000 ] + - name: col_bigint_card2_ + count: 1 + util: RandomInt + params: [ 1000001,1001000 ] + - name: col_bigint_card3_ + count: 1 + util: RandomInt + params: [ 1000001,1010000] + - name: col_bigint_id_ + count: 3 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: col_float2_ + count: 2 + util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - name: col_float5_ + count: 2 + util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - name: col_boolean_ + count: 1 + util: RandomBoolean + - name: col_varchar10_id_ + count: 1 + util: PrimaryStringGen + params: [1, 10] + - name: col_varchar100_id_ + count: 2 + util: PrimaryStringGen + params: [1, 100] + - name: col_varchar500_id_ + count: 1 + util: PrimaryStringGen + params: [1, 500] + + - table: pkeyBigint1M_child_ + count: 1 + rows: 1000000 + columns: + - name: col_bigint_id_ + count: 3 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: col_varchar10_id_ + count: 1 + util: RandomAString + params: [10, 10] + - name: col_bigint_card1_ + count: 1 + util: OneNumberFromArray + params: [ 1000000 ] + - name: col_bigint_card2_ + count: 1 + util: RandomInt + params: [ 1000001,1001000 ] + - name: col_bigint_card3_ + count: 1 + util: RandomInt + params: [ 1000001,1010000] + + executeRules: + - workload: UG4_1_no_update_to_constraint_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=1000000, col_float2_1 = col_float2_1 + 1 where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + + - workload: UG4_2_no_update_to_constraint_tbl2 + run: + - name: update_100_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_child_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=1000000, col_varchar10_id_1 = ? where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: RandomAString + params: [10, 10] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + + - workload: UG4_3_no_update_to_constraint_on_conflict_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: INSERT INTO pkeyBigint1M_1 (col_bigint_card1_1,col_bigint_card2_1,col_bigint_card3_1,col_bigint_id_1,col_bigint_id_2,col_bigint_id_3,col_float2_1,col_float2_2,col_float5_1,col_float5_2,col_boolean_1,col_varchar10_id_1,col_varchar100_id_1,col_varchar100_id_2,col_varchar500_id_1) VALUES (1000000,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (col_bigint_id_1) DO UPDATE SET col_varchar100_id_1 = ? RETURNING * + bindings: + - util: RandomInt + params: [ 1000001,1001000 ] + - util: RandomInt + params: [ 1000001,1010000] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - util: RandomBoolean + - util: PrimaryStringGen + params: [1, 10] + - util: PrimaryStringGen + params: [1, 100] + - util: PrimaryStringGen + params: [1, 100] + - util: PrimaryStringGen + params: [1, 500] + + - workload: UG4_4_update_constraint_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=3000000, col_float2_1 = col_float2_1 + 1 where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] \ No newline at end of file diff --git a/config/yugabyte/regression_pipelines/write_workloads/yb_colocated/updateG4_unmodified_set_clause.yaml b/config/yugabyte/regression_pipelines/write_workloads/yb_colocated/updateG4_unmodified_set_clause.yaml new file mode 100644 index 000000000..70c22dc7d --- /dev/null +++ b/config/yugabyte/regression_pipelines/write_workloads/yb_colocated/updateG4_unmodified_set_clause.yaml @@ -0,0 +1,193 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true +username: {{username}} +password: {{password}} +createdb: drop database if exists yb_colocated; create database yb_colocated with colocated=true +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 2 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +works: + work: + time_secs: 60 + rate: unlimited + warmup: 30 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: false + create: + - DROP TABLE IF EXISTS pkeyBigint1M_1; + - DROP TABLE IF EXISTS pkeyBigint1M_child_1; + - CREATE TABLE pkeyBigint1M_1(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1)); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card1_1); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card2_1 ASC) INCLUDE (col_bigint_id_2); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card3_1 DESC); + - CREATE UNIQUE INDEX ON pkeyBigint1M_1(col_bigint_id_3); + - CREATE TABLE pkeyBigint1M_child_1(col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_varchar10_id_1 varchar(10), col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, PRIMARY KEY(col_bigint_id_1)); + - ALTER TABLE pkeyBigint1M_child_1 ADD CONSTRAINT pkeyBigint1M_child_id1_fk FOREIGN KEY (col_bigint_id_2) REFERENCES pkeyBigint1M_1 (col_bigint_id_1); + - ALTER TABLE pkeyBigint1M_child_1 ADD CONSTRAINT pkeyBigint1M_child_id1_fk FOREIGN KEY (col_bigint_id_3) REFERENCES pkeyBigint1M_1 (col_bigint_id_3); + - CREATE INDEX ON pkeyBigint1M_child_1(col_bigint_card1_1); + + cleanup: + - DROP TABLE IF EXISTS pkeyBigint1M_1; + - DROP TABLE IF EXISTS pkeyBigint1M_child_1; + + loadRules: + - table: pkeyBigint1M_ + count: 1 + rows: 1000000 + columns: + - name: col_bigint_card1_ + count: 1 + util: OneNumberFromArray + params: [ 1000000 ] + - name: col_bigint_card2_ + count: 1 + util: RandomInt + params: [ 1000001,1001000 ] + - name: col_bigint_card3_ + count: 1 + util: RandomInt + params: [ 1000001,1010000] + - name: col_bigint_id_ + count: 3 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: col_float2_ + count: 2 + util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - name: col_float5_ + count: 2 + util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - name: col_boolean_ + count: 1 + util: RandomBoolean + - name: col_varchar10_id_ + count: 1 + util: PrimaryStringGen + params: [1, 10] + - name: col_varchar100_id_ + count: 2 + util: PrimaryStringGen + params: [1, 100] + - name: col_varchar500_id_ + count: 1 + util: PrimaryStringGen + params: [1, 500] + + - table: pkeyBigint1M_child_ + count: 1 + rows: 1000000 + columns: + - name: col_bigint_id_ + count: 3 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: col_varchar10_id_ + count: 1 + util: RandomAString + params: [10, 10] + - name: col_bigint_card1_ + count: 1 + util: OneNumberFromArray + params: [ 1000000 ] + - name: col_bigint_card2_ + count: 1 + util: RandomInt + params: [ 1000001,1001000 ] + - name: col_bigint_card3_ + count: 1 + util: RandomInt + params: [ 1000001,1010000] + + executeRules: + - workload: UG4_1_no_update_to_constraint_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=1000000, col_float2_1 = col_float2_1 + 1 where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + + - workload: UG4_2_no_update_to_constraint_tbl2 + run: + - name: update_100_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_child_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=1000000, col_varchar10_id_1 = ? where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: RandomAString + params: [10, 10] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + + - workload: UG4_3_no_update_to_constraint_on_conflict_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: INSERT INTO pkeyBigint1M_1 (col_bigint_card1_1,col_bigint_card2_1,col_bigint_card3_1,col_bigint_id_1,col_bigint_id_2,col_bigint_id_3,col_float2_1,col_float2_2,col_float5_1,col_float5_2,col_boolean_1,col_varchar10_id_1,col_varchar100_id_1,col_varchar100_id_2,col_varchar500_id_1) VALUES (1000000,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (col_bigint_id_1) DO UPDATE SET col_varchar100_id_1 = ? RETURNING * + bindings: + - util: RandomInt + params: [ 1000001,1001000 ] + - util: RandomInt + params: [ 1000001,1010000] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - util: RandomBoolean + - util: PrimaryStringGen + params: [1, 10] + - util: PrimaryStringGen + params: [1, 100] + - util: PrimaryStringGen + params: [1, 100] + - util: PrimaryStringGen + params: [1, 500] + + - workload: UG4_4_update_constraint_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=3000000, col_float2_1 = col_float2_1 + 1 where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] \ No newline at end of file diff --git a/config/yugabyte/regression_pipelines/write_workloads/yugabyte/updateG4_unmodified_set_clause.yaml b/config/yugabyte/regression_pipelines/write_workloads/yugabyte/updateG4_unmodified_set_clause.yaml new file mode 100644 index 000000000..db14b0885 --- /dev/null +++ b/config/yugabyte/regression_pipelines/write_workloads/yugabyte/updateG4_unmodified_set_clause.yaml @@ -0,0 +1,192 @@ +type: YUGABYTE +driver: com.yugabyte.Driver +url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true +username: {{username}} +password: {{password}} +batchsize: 128 +isolation: TRANSACTION_REPEATABLE_READ +loaderthreads: 2 +terminals: 1 +collect_pg_stat_statements: true +use_dist_in_explain : true +works: + work: + time_secs: 60 + rate: unlimited + warmup: 30 +microbenchmark: + class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark + properties: + setAutoCommit: false + create: + - DROP TABLE IF EXISTS pkeyBigint1M_1; + - DROP TABLE IF EXISTS pkeyBigint1M_child_1; + - CREATE TABLE pkeyBigint1M_1(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1)); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card1_1); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card2_1 ASC) INCLUDE (col_bigint_id_2); + - CREATE INDEX ON pkeyBigint1M_1(col_bigint_card3_1 DESC); + - CREATE UNIQUE INDEX ON pkeyBigint1M_1(col_bigint_id_3); + - CREATE TABLE pkeyBigint1M_child_1(col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_varchar10_id_1 varchar(10), col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, PRIMARY KEY(col_bigint_id_1)); + - ALTER TABLE pkeyBigint1M_child_1 ADD CONSTRAINT pkeyBigint1M_child_id1_fk FOREIGN KEY (col_bigint_id_2) REFERENCES pkeyBigint1M_1 (col_bigint_id_1); + - ALTER TABLE pkeyBigint1M_child_1 ADD CONSTRAINT pkeyBigint1M_child_id1_fk FOREIGN KEY (col_bigint_id_3) REFERENCES pkeyBigint1M_1 (col_bigint_id_3); + - CREATE INDEX ON pkeyBigint1M_child_1(col_bigint_card1_1); + + cleanup: + - DROP TABLE IF EXISTS pkeyBigint1M_1; + - DROP TABLE IF EXISTS pkeyBigint1M_child_1; + + loadRules: + - table: pkeyBigint1M_ + count: 1 + rows: 1000000 + columns: + - name: col_bigint_card1_ + count: 1 + util: OneNumberFromArray + params: [ 1000000 ] + - name: col_bigint_card2_ + count: 1 + util: RandomInt + params: [ 1000001,1001000 ] + - name: col_bigint_card3_ + count: 1 + util: RandomInt + params: [ 1000001,1010000] + - name: col_bigint_id_ + count: 3 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: col_float2_ + count: 2 + util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - name: col_float5_ + count: 2 + util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - name: col_boolean_ + count: 1 + util: RandomBoolean + - name: col_varchar10_id_ + count: 1 + util: PrimaryStringGen + params: [1, 10] + - name: col_varchar100_id_ + count: 2 + util: PrimaryStringGen + params: [1, 100] + - name: col_varchar500_id_ + count: 1 + util: PrimaryStringGen + params: [1, 500] + + - table: pkeyBigint1M_child_ + count: 1 + rows: 1000000 + columns: + - name: col_bigint_id_ + count: 3 + util: PrimaryIntGen + params: [ 1, 1000000 ] + - name: col_varchar10_id_ + count: 1 + util: RandomAString + params: [10, 10] + - name: col_bigint_card1_ + count: 1 + util: OneNumberFromArray + params: [ 1000000 ] + - name: col_bigint_card2_ + count: 1 + util: RandomInt + params: [ 1000001,1001000 ] + - name: col_bigint_card3_ + count: 1 + util: RandomInt + params: [ 1000001,1010000] + + executeRules: + - workload: UG4_1_no_update_to_constraint_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=1000000, col_float2_1 = col_float2_1 + 1 where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + + - workload: UG4_2_no_update_to_constraint_tbl2 + run: + - name: update_100_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_child_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=1000000, col_varchar10_id_1 = ? where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: RandomAString + params: [10, 10] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + + - workload: UG4_3_no_update_to_constraint_on_conflict_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: INSERT INTO pkeyBigint1M_1 (col_bigint_card1_1,col_bigint_card2_1,col_bigint_card3_1,col_bigint_id_1,col_bigint_id_2,col_bigint_id_3,col_float2_1,col_float2_2,col_float5_1,col_float5_2,col_boolean_1,col_varchar10_id_1,col_varchar100_id_1,col_varchar100_id_2,col_varchar500_id_1) VALUES (1000000,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (col_bigint_id_1) DO UPDATE SET col_varchar100_id_1 = ? RETURNING * + bindings: + - util: RandomInt + params: [ 1000001,1001000 ] + - util: RandomInt + params: [ 1000001,1010000] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 2 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - util: RandomNoWithDecimalPoints + params: [ 1, 1000000, 5 ] + - util: RandomBoolean + - util: PrimaryStringGen + params: [1, 10] + - util: PrimaryStringGen + params: [1, 100] + - util: PrimaryStringGen + params: [1, 100] + - util: PrimaryStringGen + params: [1, 500] + + - workload: UG4_4_update_constraint_tbl1 + run: + - name: update_10_cols + weight: 100 + queries: + - query: UPDATE pkeyBigint1M_1 SET col_bigint_id_1=?, col_bigint_id_2=?,col_bigint_id_3=?, col_bigint_card1_1=3000000, col_float2_1 = col_float2_1 + 1 where col_bigint_id_1 = ? + bindings: + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1000001, 2000000 ] + - util: PrimaryIntGen + params: [ 1, 1000000 ] \ No newline at end of file From 51f4caafe6cad4caa150db1d6546b1b5b1a6c3e9 Mon Sep 17 00:00:00 2001 From: Shantanu Gupta Date: Tue, 23 Jul 2024 12:11:12 +0530 Subject: [PATCH 2/2] Increased Pkey range to avoid out of bound error --- .../postgres/MG2_multi_statement_transaction.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/yugabyte/regression_pipelines/miscellaneous/postgres/MG2_multi_statement_transaction.yaml b/config/yugabyte/regression_pipelines/miscellaneous/postgres/MG2_multi_statement_transaction.yaml index 96d1884c4..304a92ed7 100644 --- a/config/yugabyte/regression_pipelines/miscellaneous/postgres/MG2_multi_statement_transaction.yaml +++ b/config/yugabyte/regression_pipelines/miscellaneous/postgres/MG2_multi_statement_transaction.yaml @@ -108,11 +108,11 @@ microbenchmark: - query: INSERT INTO audit_table_1(account_id_1, event_id_1, user_id_1, delta_1) VALUES(?,?,?,?) bindings: - util: PrimaryIntGen - params: [ 2000000, 100000000 ] + params: [ 2000000, 100000000000 ] - util: PrimaryDateGen params: [ 100000000 ] - util: PrimaryIntGen - params: [ 2000000, 100000000 ] + params: [ 2000000, 100000000000 ] - util: RandomNoWithDecimalPoints params: [ 1, 1000000, 2 ] - query: UPDATE accounts_1 SET bal_1 = ? WHERE account_id_1 = ? and user_id_1 = ?