pg_ycsb implements basic YCSB-like workloads designed specifically to be run with pgbench.
What is YCSB
YCSB is a framework and common set of workloads for performance evaluating of different kinds of database systems.
workload A Update heavy workload. Example: session store recording recent actions. 50% reads, 50% updates
workload B Read mostly workload. Example: photo tagging; add a tag is an update, but most operations are to read tags. 95% reads, 5% updates
workload C Read only. Example: user profile cache, where profiles are constructed elsewhere. 100% reads
workload D Read latest workload. Example: user status updates; people want to read the latest. 95% reads, 5% inserts (WIP)
workload E Short ranges. Example: threaded conversations, where each scan is for the posts in a given thread. 95% scans, 5% inserts (WIP)
workload F Read-modify-write workload. Example: user database, where user records are read and modified by the user or to record user activity. 50% reads, 50% inserts (WIP)
Why use pgbench?
pgbench is a lightweight and flexible framework and usually goes with PostgreSQL. By default it performs TPC-B like benchmarks and widely used across developers. But in some cases default scripts fail to provide comprehensive measurements. pg_ycsb is a set of scripts which enables developers to run YCSB-like workloads with pgbench and using pgbench's default table set.
Full documentation on pgbench can be found in official documentation. The most important options are:
Add script to the list of executed scripts and
weight represents probability of the execution of this script.
Total time of execution.
Number of concurrent clients.
pgbench postgres -f scripts/zipfian/read.sql@50 -f scripts/zipfian/update.sql@50 -T60 -c10
pgbench postgres -f scripts/zipfian/read.sql@95 -f scripts/zipfian/update.sql@5 -T60 -c10
pgbench postgres -f scripts/zipfian/read.sql -T60 -c10
Not implemented yet.
pgbench postgres -f scripts/zipfian/scan.sql@95 -f scripts/uniform/insert.sql@5 -T60 -c10
Not implemented yet.