[docs] Add instructions to recreate a partition index#31362
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a new section to the YSQL documentation titled "Recreate a partition index", providing a step-by-step guide for recreating indexes on partitioned tables online using a detach-and-reattach strategy. The feedback suggests changing the language tag of the example code block from "plpgsql" to "sql" to ensure more accurate syntax highlighting, as the block contains standard SQL statements rather than procedural code.
| To recreate indexes, you should avoid directly creating an index on the partitioned table (parent table) because that cannot use `CONCURRENTLY`. | ||
| Follow these steps to recreate a partition index online: | ||
|
|
||
| ```plpgsql |
✅ Deploy Preview for infallible-bardeen-164bc9 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
aishwarya24
left a comment
There was a problem hiding this comment.
LGTM with minor comments.
|
@jaki : @aishwarya24 : Would be good to place the existing steps which deal with related scenarios at https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/ddl_create_index/#only along with this new section together. Maybe we can move the current section and this new part into a new subsection like Concurrent index creation for partitioned tables Concurrent index creation for partitioned tablesCreating indexes concurrently on partitioned tables/* Current docs */ Recreating unique index constraints concurrently on partitioned tablesRecreating unique index constraints involves a similar process as the previous section. However, there is an extra challenge that dropping an existing inherited constraint is not allowed. You can follow this sequence below when object locking is enabled. |
in accordance with yugabyte#31362 (comment).
Make the recreate-partition-index note accurate about the optional protected path: - Step 4 LOCK and its surrounding BEGIN/COMMIT block are jointly optional; drop both and run the steps individually if the parent has no concurrent reads or writes during the detach. - Object locking (enable_object_locking_for_table_locks) gates the LOCK. - Transactional DDL (ysql_yb_ddl_transaction_block_enabled) gates the BEGIN/COMMIT block, and object locking depends on it. Neither flag is a preview flag in 2025.2+, so no allowed_preview_flags_csv entry is needed. Also reword the step 6 comment to drop the inaccurate "inherited", since the partition is already detached by then.
bf27b51 to
94c3e8d
Compare
No description provided.