Another example of a sharding function (#41)

* Another example of a sharding function

* tests
This commit is contained in:
Lev Kokotov
2022-02-23 11:47:24 -08:00
committed by Lev Kokotov
parent dce72ba262
commit b3c8ca4b8a
4 changed files with 99 additions and 12 deletions

View File

@@ -96,3 +96,13 @@ query_parser_enabled = false
# load balancing of read queries. Otherwise, the primary will only be used for write
# queries. The primary can always be explicitely selected with our custom protocol.
primary_reads_enabled = true
# So what if you wanted to implement a different hashing function,
# or you've already built one and you want this pooler to use it?
#
# Current options:
#
# pg_bigint_hash: PARTITION BY HASH (Postgres hashing function)
# sha1: A hashing function based on SHA1
#
sharding_function = "pg_bigint_hash"