Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--
-- src/test/performance/cfs/pgbench_readwrite.sql
--
-- Custom pgbench script: short read/write transaction that updates a random
-- row's payload.  Each UPDATE rewrites a CFS page, producing a new compressed
-- record in the .cfp and leaving the previous record as dead space -- exactly
-- the workload the background compactor reclaims.
--
--   pgbench -n -c <clients> -j <threads> -T <seconds> \
--           -f pgbench_readwrite.sql -D scale=1000 <db>
 
\set id random(1, :scale)
\set len random(1, 16)
BEGIN;
UPDATE :table SET payload = repeat(md5(:id::text), :len) WHERE id = :id;
SELECT payload FROM :table WHERE id = :id;
COMMIT;