Skip to content
Open
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
8 changes: 8 additions & 0 deletions benches/perf/sharding/pgdog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ host = "localhost"
role = "replica"
shard = 2
database_name = "pgdog3"

[[sharded_tables]]
database = "pgdog"
column = "id"
name = "sharding_bench"

[rewrite]
split_inserts = "rewrite"
7 changes: 5 additions & 2 deletions benches/perf/sharding/script.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
\set id random(1, 30)
\set id random(1, 10000)
\set id2 random(10000, 20000)
\set id3 random(20000, 30000)

SELECT * FROM sharding_bench WHERE id = :id;

INSERT INTO sharding_bench (id, value) VALUES (:id, 'test1'), (:id2, 'test3'), (:id3, 'test3');
2 changes: 1 addition & 1 deletion benches/perf/sharding/setup.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DROP TABLE IF EXISTS sharding_bench;
CREATE TABLE sharding_bench (id BIGINT PRIMARY KEY, value TEXT, created_at TIMESTAMPTZ DEFAULT NOW());
CREATE TABLE sharding_bench (id BIGINT, value TEXT, created_at TIMESTAMPTZ DEFAULT NOW());

INSERT INTO sharding_bench VALUES (1, 'test1');
INSERT INTO sharding_bench VALUES (2, 'test2');
Expand Down
Loading