|
| 1 | +-- |
| 2 | +-- Check that system tables can be reindexed. |
| 3 | +-- |
| 4 | +-- Note that this test currently has to run without parallel tests |
| 5 | +-- being scheduled, as currently reindex catalog tables can cause |
| 6 | +-- deadlocks: |
| 7 | +-- |
| 8 | +-- * The lock upgrade between the ShareLock acquired for the reindex |
| 9 | +-- and RowExclusiveLock needed for pg_class/pg_index locks can |
| 10 | +-- trigger deadlocks. |
| 11 | +-- |
| 12 | +-- * The uniqueness checks performed when reindexing a unique/primary |
| 13 | +-- key index possibly need to wait for the transaction of a |
| 14 | +-- about-to-deleted row in pg_class to commit. That can cause |
| 15 | +-- deadlocks because, in contrast to user tables, locks on catalog |
| 16 | +-- tables are routinely released before commit - therefore the lock |
| 17 | +-- held for reindexing doesn't guarantee that no running transaction |
| 18 | +-- performed modifications in the table underlying the index. |
| 19 | +-- Check reindexing of whole tables |
| 20 | +REINDEX TABLE pg_class; -- mapped, non-shared, critical |
| 21 | +REINDEX TABLE pg_index; -- non-mapped, non-shared, critical |
| 22 | +REINDEX TABLE pg_operator; -- non-mapped, non-shared, critical |
| 23 | +REINDEX TABLE pg_database; -- mapped, shared, critical |
| 24 | +REINDEX TABLE pg_shdescription; -- mapped, shared non-critical |
| 25 | +-- Check that individual system indexes can be reindexed. That's a bit |
| 26 | +-- different from the entire-table case because reindex_relation |
| 27 | +-- treats e.g. pg_class special. |
| 28 | +REINDEX INDEX pg_class_oid_index; -- mapped, non-shared, critical |
| 29 | +REINDEX INDEX pg_class_relname_nsp_index; -- mapped, non-shared, non-critical |
| 30 | +REINDEX INDEX pg_index_indexrelid_index; -- non-mapped, non-shared, critical |
| 31 | +REINDEX INDEX pg_index_indrelid_index; -- non-mapped, non-shared, non-critical |
| 32 | +REINDEX INDEX pg_database_oid_index; -- mapped, shared, critical |
| 33 | +REINDEX INDEX pg_shdescription_o_c_index; -- mapped, shared, non-critical |
0 commit comments