Исходный код СУБД 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_readonly.sql
--
-- Custom pgbench script: read-only point lookups by primary key against a
-- single CFS/plain table.  Use with:
--
--   pgbench -n -c <clients> -j <threads> -T <seconds> \
--           -f pgbench_readonly.sql -D scale=1000 <db>
--
-- The :scale variable controls the id range drawn from the table populated by
-- cfs_perf_setup.sql.  Each transaction reads one random row, forcing the
-- buffer manager to decompress the CFS page on a cache miss.
 
\set id random(1, :scale)
BEGIN;
SELECT payload FROM :table WHERE id = :id;
COMMIT;