Last active
April 20, 2022 07:39
-
-
Save enykeev/19f145af03d92ec6b2b1df9c57fb1aa3 to your computer and use it in GitHub Desktop.
PG 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
-- Kafka-like partitioning | |
select abs(hashtext(id)) % 10 as partition, count(*) from events group by partition |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment