[[server]] name = "Primary" [server.style.Automatic] [server.setup] sql = """ DROP EXTENSION IF EXISTS pg_search CASCADE; DROP TABLE IF EXISTS test CASCADE; CREATE EXTENSION pg_search; CREATE TABLE test ( id SERIAL8 NOT NULL PRIMARY KEY, message TEXT, severity INTEGER ); INSERT INTO test (message, severity) SELECT CASE id % 3 WHEN 0 THEN 'drink some beer' WHEN 1 THEN 'sip some wine' WHEN 2 THEN 'eat some cheese' END, (random() * 4 + 1)::int FROM generate_series(1, 1000000) as id; CREATE INDEX idxtest ON test USING bm25(id, message, severity) WITH (key_field = 'id', target_segment_count = 16, layer_sizes = '1kb', background_layer_sizes = '10kb, 100kb, 1mb, 10mb'); 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; $$; ALTER DATABASE stressgres SET work_mem = '1GB'; """ [server.teardown] sql = """ DROP TABLE test CASCADE; DROP EXTENSION pg_search CASCADE; """ [server.monitor] refresh_ms = 100 title = "Watch Segment Count" # Combined query returning both columns sql = """ SELECT segno, num_docs, num_deleted, pg_size_pretty(byte_size) FROM paradedb.index_info('idxtest') ORDER BY num_docs DESC; """ [[jobs]] refresh_ms = 100 title = "Monitor Segment Count" log_columns = ["block_count", "segment_count"] log_tps = false # 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 = 5 title = "Custom scan" log_tps = true sql = """ SELECT assert(COUNT(*), 333333) FROM test WHERE message @@@ 'drink'; """ [[jobs]] refresh_ms = 5 title = "Update random values" log_tps = true 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 = 5 title = "Update random values" log_tps = true sql = """ UPDATE test SET message = substring(message FROM 1 FOR length(message)-1) || chr((trunc(random() * 26) + 65)::int) WHERE id > 10 AND id < 1000; """ [[jobs]] refresh_ms = 5 title = "Insert value" log_tps = true sql = """ INSERT INTO test (message) VALUES ('lore ispum dolor'); """ [[jobs]] refresh_ms = 5 title = "Delete value" log_tps = true sql = """ DELETE FROM test WHERE id > 1000001; """ [[jobs]] refresh_ms = 1000 title = "Vacuum" log_tps = true sql = """ VACUUM test; """