21 #define DEFAULT_INDEX_TYPE "btree"
41 #define REINDEXOPT_VERBOSE 0x01
42 #define REINDEXOPT_REPORT_PROGRESS 0x02
43 #define REINDEXOPT_MISSING_OK 0x04
44 #define REINDEXOPT_CONCURRENTLY 0x08
61 #define INDEX_CREATE_IS_PRIMARY (1 << 0)
62 #define INDEX_CREATE_ADD_CONSTRAINT (1 << 1)
63 #define INDEX_CREATE_SKIP_BUILD (1 << 2)
64 #define INDEX_CREATE_CONCURRENT (1 << 3)
65 #define INDEX_CREATE_IF_NOT_EXISTS (1 << 4)
66 #define INDEX_CREATE_PARTITIONED (1 << 5)
67 #define INDEX_CREATE_INVALID (1 << 6)
70 const char *indexRelationName,
73 Oid parentConstraintId,
77 Oid accessMethodObjectId,
79 Oid *collationObjectId,
85 bool allow_system_table_mods,
89 #define INDEX_CONSTR_CREATE_MARK_AS_PRIMARY (1 << 0)
90 #define INDEX_CONSTR_CREATE_DEFERRABLE (1 << 1)
91 #define INDEX_CONSTR_CREATE_INIT_DEFERRED (1 << 2)
92 #define INDEX_CONSTR_CREATE_UPDATE_INDEX (1 << 3)
93 #define INDEX_CONSTR_CREATE_REMOVE_OLD_DEPS (1 << 4)
101 Oid indexRelationId);
105 const char *oldName);
112 Oid parentConstraintId,
114 const char *constraintName,
117 bool allow_system_table_mods,
120 extern void index_drop(
Oid indexId,
bool concurrent,
bool concurrent_lock_mode);
127 Oid *collations1,
Oid *collations2,
128 Oid *opfamilies1,
Oid *opfamilies2,
155 #define REINDEX_REL_PROCESS_TOAST 0x01
156 #define REINDEX_REL_SUPPRESS_INDEX_USE 0x02
157 #define REINDEX_REL_CHECK_CONSTRAINTS 0x04
158 #define REINDEX_REL_FORCE_INDEXES_UNLOGGED 0x08
159 #define REINDEX_REL_FORCE_INDEXES_PERMANENT 0x10
197 encoded = ((uint64) block << 16) | (
uint16) offset;
static Datum values[MAXATTR]
bool ReindexIsProcessingIndex(Oid indexOid)
ObjectAddress index_constraint_create(Relation heapRelation, Oid indexRelationId, Oid parentConstraintId, IndexInfo *indexInfo, const char *constraintName, char constraintType, bits16 constr_flags, bool allow_system_table_mods, bool is_internal)
void validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
void index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
void ResetReindexState(int nestLevel)
Oid IndexGetRelation(Oid indexId, bool missing_ok)
struct ValidateIndexState ValidateIndexState
void index_concurrently_set_dead(Oid heapId, Oid indexId)
void index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
void RestoreReindexState(void *reindexstate)
static void itemptr_decode(ItemPointer itemptr, int64 encoded)
bool CompareIndexInfo(IndexInfo *info1, IndexInfo *info2, Oid *collations1, Oid *collations2, Oid *opfamilies1, Oid *opfamilies2, AttrMap *attmap)
void index_set_state_flags(Oid indexId, IndexStateFlagsAction action)
IndexInfo * BuildDummyIndexInfo(Relation index)
static int64 itemptr_encode(ItemPointer itemptr)
void IndexSetParentIndex(Relation partitionIdx, Oid parentOid)
Oid index_create(Relation heapRelation, const char *indexRelationName, Oid indexRelationId, Oid parentIndexRelid, Oid parentConstraintId, RelFileNumber relFileNumber, IndexInfo *indexInfo, List *indexColNames, Oid accessMethodObjectId, Oid tableSpaceId, Oid *collationObjectId, Oid *classObjectId, int16 *coloptions, Datum reloptions, bits16 flags, bits16 constr_flags, bool allow_system_table_mods, bool is_internal, Oid *constraintId)
void SerializeReindexState(Size maxsize, char *start_address)
Oid index_concurrently_create_copy(Relation heapRelation, Oid oldIndexId, Oid tablespaceOid, const char *newName)
void BuildSpeculativeIndexInfo(Relation index, IndexInfo *ii)
void reindex_index(Oid indexId, bool skip_constraint_checks, char persistence, ReindexParams *params)
bool ReindexIsProcessingHeap(Oid heapOid)
bool reindex_relation(Oid relid, int flags, ReindexParams *params)
struct ReindexParams ReindexParams
void index_check_primary_key(Relation heapRel, IndexInfo *indexInfo, bool is_alter_table, IndexStmt *stmt)
void index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isreindex, bool parallel)
void FormIndexDatum(IndexInfo *indexInfo, TupleTableSlot *slot, EState *estate, Datum *values, bool *isnull)
void index_concurrently_build(Oid heapRelationId, Oid indexRelationId)
Size EstimateReindexStateSpace(void)
IndexInfo * BuildIndexInfo(Relation index)
static void ItemPointerSet(ItemPointerData *pointer, BlockNumber blockNumber, OffsetNumber offNum)
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
Tuplesortstate * tuplesort