Skip to content

Instantly share code, notes, and snippets.

@zilder
Created May 18, 2016 14:14
Show Gist options
  • Save zilder/872e634a8eeb405bd045465fc9527e53 to your computer and use it in GitHub Desktop.
Save zilder/872e634a8eeb405bd045465fc9527e53 to your computer and use it in GitHub Desktop.
pgbench scripts for range partitioning
\set var random(1, 1000 * :partitions)
BEGIN;
SELECT * FROM abc WHERE a = :var;
END;
\set start random(1, :partitions) * 1000
BEGIN;
SELECT * FROM abc WHERE a >= :start and a < :start + 1000;
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment