Skip to content

Set join_collapse_limit default value to the same as used in PostgreS…#360

Merged
Alena0704 merged 2 commits intoOPENGPDB_STABLEfrom
fix_join_collapse_limit
Mar 11, 2026
Merged

Set join_collapse_limit default value to the same as used in PostgreS…#360
Alena0704 merged 2 commits intoOPENGPDB_STABLEfrom
fix_join_collapse_limit

Conversation

@Alena0704
Copy link
Contributor

@Alena0704 Alena0704 commented Mar 9, 2026

Set join_collapse_limit default value to 13

The default value of join_collapse_limit was 20. When this value is set and
the query contains about 20 joins (see added test), Postgres query optimizer
cannot build a plan during hours and consumes a lot of memory, because the
planner checks a lot of possible ways to join the tables.
When join_collapse_limit is 8, the query plan is built in reasonable time.

Cherry-picked from Apache Cloudberry:
https://github.com/apache/cloudberry/commit/b245e4d758a8a1d0c3fb0269b088d51a6ba5e728

@Alena0704
Copy link
Contributor Author

Нужно ли указать ссылку в коммит месседж на исходный патч apache/cloudberry#1525, где был фикс?

@andr-sokolov
Copy link
Contributor

Нужно ли указать ссылку в коммит месседж на исходный патч apache/cloudberry#1525, где был фикс?

да, надо, чтобы было понятно, откуда взяты изменения

@andr-sokolov
Copy link
Contributor

join_collapse_limit is 13 in Cloudberry. Why is 13 replaced with 8?

@Alena0704 Alena0704 force-pushed the fix_join_collapse_limit branch 4 times, most recently from bbd5c8e to 4735ceb Compare March 10, 2026 11:05
The default value of join_collapse_limit was 20. When this value is set and
the query contains about 20 joins (see added test), Postgres query optimizer
cannot build a plan during hours and consumes a lot of memory, because the
planner checks a lot of possible ways to join the tables.
When join_collapse_limit is 13, the query plan is built in reasonable time.

Cherry-picked from Apache Cloudberry:
apache/cloudberry@b245e4d
@Alena0704 Alena0704 force-pushed the fix_join_collapse_limit branch 4 times, most recently from 30b42ba to 9627d4f Compare March 10, 2026 15:32
@Alena0704 Alena0704 force-pushed the fix_join_collapse_limit branch from 9627d4f to ac1509d Compare March 10, 2026 15:35
@Alena0704
Copy link
Contributor Author

Alena0704 commented Mar 10, 2026

I have added the second commit to fix 'distributed by' notices in bfv_joins test.

@Alena0704 Alena0704 merged commit 5794f50 into OPENGPDB_STABLE Mar 11, 2026
42 of 45 checks passed
@Alena0704 Alena0704 deleted the fix_join_collapse_limit branch March 11, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants