[setup_primary] sql = """ DROP TABLE IF EXISTS test CASCADE; CREATE EXTENSION IF NOT EXISTS pg_search; CREATE TABLE test ( id SERIAL8 NOT NULL PRIMARY KEY, message TEXT ); DROP PUBLICATION IF EXISTS stressgres_pub; CREATE PUBLICATION stressgres_pub FOR ALL TABLES; INSERT INTO test (message) VALUES ('beer wine cheese a'); INSERT INTO test (message) VALUES ('beer wine a'); INSERT INTO test (message) VALUES ('beer cheese a'); INSERT INTO test (message) VALUES ('beer a'); INSERT INTO test (message) VALUES ('wine cheese a'); INSERT INTO test (message) VALUES ('wine a'); INSERT INTO test (message) VALUES ('cheese a'); INSERT INTO test (message) VALUES ('beer wine cheese a'); INSERT INTO test (message) VALUES ('beer wine a'); INSERT INTO test (message) VALUES ('beer cheese a'); INSERT INTO test (message) VALUES ('beer a'); INSERT INTO test (message) VALUES ('wine cheese a'); INSERT INTO test (message) VALUES ('wine a'); INSERT INTO test (message) VALUES ('cheese a'); """ [setup_secondary] sql = """ DROP TABLE IF EXISTS test CASCADE; CREATE EXTENSION IF NOT EXISTS pg_search; CREATE TABLE test ( id SERIAL8 NOT NULL PRIMARY KEY, message TEXT ); DROP SUBSCRIPTION IF EXISTS stressgres_sub; CREATE SUBSCRIPTION stressgres_sub CONNECTION '@PRIMARY_CONNSTR@' PUBLICATION stressgres_pub; SELECT pg_sleep(5); CREATE INDEX idxtest ON test USING bm25(id, message) WITH (key_field = 'id'); CREATE OR REPLACE FUNCTION assert(a bigint, b bigint) RETURNS bool LANGUAGE plpgsql AS $$ DECLARE current_txid bigint; BEGIN -- Get the current transaction ID current_txid := txid_current(); -- Check if the values are not equal IF a <> b THEN RAISE EXCEPTION 'Assertion failed: % <> %. Transaction ID: %', a, b, current_txid; END IF; RETURN true; END; $$; """ [teardown] sql = """ destination = "Both" DROP TABLE test CASCADE; DROP EXTENSION pg_search CASCADE; """ [monitor] refresh_ms = 10 title = "Monitor Index Size" log_tps = true log_columns = ["block_count", "segment_count"] destination = "Secondary" # Combined query returning both columns sql = """ SELECT pg_relation_size('idxtest') / current_setting('block_size')::int AS block_count, ( SELECT COUNT(*)::bigint FROM paradedb.index_info('idxtest') ) AS segment_count """ [[jobs]] refresh_ms = 100 title = "Index Scan" log_tps = true destination = "Secondary" sql = """ SET enable_indexonlyscan to OFF; SELECT assert(count(*)::bigint, 8::bigint), count(*) FROM test where id @@@ 'message:cheese'; """ [[jobs]] refresh_ms = 5 title = "Custom Scan" log_tps = true destination = "Secondary" sql = """ SET enable_indexonlyscan to OFF; SET enable_indexscan to OFF; SELECT assert(count(*)::bigint, 8::bigint), count(*) FROM test where id @@@ 'message:beer'; """ [[jobs]] refresh_ms = 5 title = "Index Only Scan" log_tps = true destination = "Secondary" sql = """ SELECT assert(count(*)::bigint, 8::bigint), count(*) FROM test where id @@@ 'message:wine'; """ [[jobs]] refresh_ms = 25 title = "Update random values" log_tps = true destination = "Primary" sql = """ UPDATE test SET message = substring(message FROM 1 FOR length(message)-1) || chr((trunc(random() * 26) + 65)::int) WHERE id < 10; """ [[jobs]] refresh_ms = 10 title = "Insert value" log_tps = true destination = "Primary" sql = """ INSERT INTO test (message) VALUES ('test'); """ [[jobs]] refresh_ms = 10 title = "Insert value" log_tps = true destination = "Primary" sql = """ INSERT INTO test (message) VALUES ('test'); """ [[jobs]] refresh_ms = 10 title = "Delete values" log_tps = true destination = "Primary" sql = """ DELETE FROM test WHERE id > 14; """ [[jobs]] refresh_ms = 3000 title = "Vacuum" log_tps = true destination = "Secondary" sql = """ SET vacuum_freeze_min_age = 0; VACUUM test; """