I am using Citus as a managed service in the cloud with Azure Cosmos DB for PostgreSQL.
I have 1 coordinator and 2 worker nodes setup.
There are distributed tables and reference tables created.
Distributed tables are horizontally partitioned across all nodes.
A reference table is a table whose entire contents are concentrated into a single shard which is replicated on every worker.
For each distributed table, about 30 shards were created.
3 shards were created for each reference table given that there are 3 nodes in total.
Citus Shards Query
Upon executing the above query to get all shards, I see that the shards of the distributed tables are spread across all nodes by looking at the nodename column.
Also for reference tables, I see all shards are duplicated across all nodes.
However, I noticed that the colocation ID of all reference table shards is the same (say 23).
And the colocation ID of all distributed table shards is the same (say 26).
This does not make sense to me given that the shards of distributed and reference tables are present in all nodes.
This is how the output looks like:
Query Output
Can anyone explain the behavior of this?
Rohith K is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.