Created
May 18, 2016 14:14
-
-
Save zilder/872e634a8eeb405bd045465fc9527e53 to your computer and use it in GitHub Desktop.
pgbench scripts for range partitioning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\set var random(1, 1000 * :partitions) | |
BEGIN; | |
SELECT * FROM abc WHERE a = :var; | |
END; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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