From 1f4a2e53e2993d605a6c83c4ee6150b0526a34cc Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Tue, 8 Feb 2022 13:13:12 -0800 Subject: [PATCH] readme --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7217e9..e063528 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,18 @@ We're implemeting Postgres' `PARTITION BY HASH` sharding function for `BIGINT` f The biggest advantage of using this sharding function is that anyone can shard the dataset using Postgres partitions while also access it for both reads and writes using this pooler. No custom obscure sharding function is needed and database sharding can be done entirely in Postgres. +To select the shard we want to talk to, we introduced special syntax: + +```sql +SET SHARDING KEY TO '1234'; +``` + +This sharding key will be hashed and the pooler will select a shard to use for the next transaction. If the pooler is in session mode, this sharding key will be used until it's set again or the client disconnects. + ## Missing -1. Query routing based on shard. -2. Authentication, ehem, this proxy is letting anyone in at the moment. +1. Authentication, ehem, this proxy is letting anyone in at the moment. ## Benchmarks