Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--
-- src/test/performance/cfs/pgbench_hotupdate.sql
--
-- Custom pgbench script: random UPDATE of an existing row.  Unlike the
-- read-write script (which touches a single hot row in a cache-resident
-- table), this one is meant to run against a table that is several times
-- larger than shared_buffers, so every UPDATE that evicts a dirty page
-- forces CFS to compress it and append a new record to the .cfp, leaving
-- the previous record as dead space.  This is the workload that exposes
-- the real CPU cost of CFS compression (see pgbench_writeheavy.sh).
--
--   pgbench -n -c <clients> -j <threads> -T <seconds> \
--           -f pgbench_hotupdate.sql -D scale=50000 -D table=evic_lz4 <db>
 
\set id random(1, :scale)
UPDATE :table SET payload = repeat('u' || (:id % 50), :payload_len) WHERE id = :id