1

I have 2 tables in postgres, which are present in the separate schemas under same database.

While executing the SQL using the join between these 2 tables, getting the error as

table1 and table2 are not colocated

When checked the citus_shards table, both the tables are on same node, but the colocation id are different for both the tables.

citus.enable_repartition_joins is also set to true

Can someone please help?

asked Nov 26, 2024 at 10:46
1
  • Can someone please help? Commented Dec 2, 2024 at 8:28

1 Answer 1

0

Colocation of the two tables table1 and table2 is a condition on the distribution of the outer join between these two tables. Therefore, when you try to run an outer join between table1 and table2, you are seeing that error.

To overcome that error, the tables should be colocated. This basically means that shards of the distributed table should match one to one, i.e. each shard of table1 should overlap with one and only one shard from table2. Different partition (distribution) column types between table1 and table2 is the most common reason of resulting in non-colocated tables.
So, you should make sure that table1 and table2 have the same partition column type.

answered Mar 25, 2025 at 19:11
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.