GitHub user 18w added a comment to the discussion: Does Cloudberry support 
`CREATE INDEX` / `REINDEX` / `DROP INDEX CONCURRENTLY`?

Hi @yanboer,

>From the code, yes, they are really implemented and not just accepted by the 
>parser. In `src/backend/commands/indexcmds.c` (same in the 2.0.0-incubating 
>and 2.2.0-incubating tags) `CREATE INDEX CONCURRENTLY` and `REINDEX ... 
>CONCURRENTLY` run the usual PG phases, but the QD dispatches each phase to the 
>segments separately (`concurrentlyPhase`, "dispatch Phase 2/3 of concurrently 
>index build"). So the docs pages look outdated for CREATE INDEX and REINDEX.

Limitations I found in the same file:

- **AO/CO tables**: `cannot create index on append-only table "..." 
concurrently`. The comment says the AO/AOCS table AM doesn't implement 
`index_validate_scan`, which phase 3 needs. There's a separate error for unique 
indexes on AO built concurrently.
- **Partitioned tables**: `cannot create index on partitioned table "..." 
concurrently` (same as PG 14). For REINDEX CONCURRENTLY, partitioned 
tables/indexes hit `cannot reindex this type of relation concurrently`, so you 
have to reindex the leaf partitions one by one.
- **Invalid indexes**: REINDEX CONCURRENTLY skips them with `cannot reindex 
invalid index "..." concurrently, skipping`, and the same for exclusion 
constraint indexes. A failed CIC leaves an invalid index behind like in PG: 
drop it (`DROP INDEX CONCURRENTLY` works) and build it again.
- **Partial/expression indexes** are supported. edb0f6e ("Fix waits of REINDEX 
CONCURRENTLY for indexes with predicates or expressions") fixed the waiting 
logic for them.
- System catalogs can't be reindexed concurrently.

One more thing since your build has assert checking: 867c6a1 on main ("Fix 
assert failure triggered by CREATE INDEX CONCURRENTLY", #1845) fixes an 
assertion failure in CIC when resource groups are enabled. Worth checking if 
your version has it before relying on CIC.

GitHub link: 
https://github.com/apache/cloudberry/discussions/2264#discussioncomment-19469223

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to