Remove argument isprimary from index_build()
The flag was introduced in3fdeb18
, butf66e8bf
actually forgot to finish the cleanup as index_update_stats() has simplified its interface. Author: Michael Paquier Discussion: https://postgr.es/m/20190122080852.GB3873@paquier.xyz
This commit is contained in:
parent
95931133a9
commit
289198c0d9
|
@ -1130,7 +1130,7 @@ build_indices(void)
|
||||||
heap = table_open(ILHead->il_heap, NoLock);
|
heap = table_open(ILHead->il_heap, NoLock);
|
||||||
ind = index_open(ILHead->il_ind, NoLock);
|
ind = index_open(ILHead->il_ind, NoLock);
|
||||||
|
|
||||||
index_build(heap, ind, ILHead->il_info, false, false, false);
|
index_build(heap, ind, ILHead->il_info, false, false);
|
||||||
|
|
||||||
index_close(ind, NoLock);
|
index_close(ind, NoLock);
|
||||||
table_close(heap, NoLock);
|
table_close(heap, NoLock);
|
||||||
|
|
|
@ -3063,7 +3063,7 @@ RelationTruncateIndexes(Relation heapRelation)
|
||||||
|
|
||||||
/* Initialize the index and rebuild */
|
/* Initialize the index and rebuild */
|
||||||
/* Note: we do not need to re-establish pkey setting */
|
/* Note: we do not need to re-establish pkey setting */
|
||||||
index_build(heapRelation, currentIndex, indexInfo, false, true, false);
|
index_build(heapRelation, currentIndex, indexInfo, true, false);
|
||||||
|
|
||||||
/* We're done with this index */
|
/* We're done with this index */
|
||||||
index_close(currentIndex, NoLock);
|
index_close(currentIndex, NoLock);
|
||||||
|
|
|
@ -1189,8 +1189,7 @@ index_create(Relation heapRelation,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
index_build(heapRelation, indexRelation, indexInfo, isprimary, false,
|
index_build(heapRelation, indexRelation, indexInfo, false, true);
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2220,13 +2219,9 @@ index_update_stats(Relation rel,
|
||||||
* entries of the index and heap relation as needed, using statistics
|
* entries of the index and heap relation as needed, using statistics
|
||||||
* returned by ambuild as well as data passed by the caller.
|
* returned by ambuild as well as data passed by the caller.
|
||||||
*
|
*
|
||||||
* isprimary tells whether to mark the index as a primary-key index.
|
|
||||||
* isreindex indicates we are recreating a previously-existing index.
|
* isreindex indicates we are recreating a previously-existing index.
|
||||||
* parallel indicates if parallelism may be useful.
|
* parallel indicates if parallelism may be useful.
|
||||||
*
|
*
|
||||||
* Note: when reindexing an existing index, isprimary can be false even if
|
|
||||||
* the index is a PK; it's already properly marked and need not be re-marked.
|
|
||||||
*
|
|
||||||
* Note: before Postgres 8.2, the passed-in heap and index Relations
|
* Note: before Postgres 8.2, the passed-in heap and index Relations
|
||||||
* were automatically closed by this routine. This is no longer the case.
|
* were automatically closed by this routine. This is no longer the case.
|
||||||
* The caller opened 'em, and the caller should close 'em.
|
* The caller opened 'em, and the caller should close 'em.
|
||||||
|
@ -2235,7 +2230,6 @@ void
|
||||||
index_build(Relation heapRelation,
|
index_build(Relation heapRelation,
|
||||||
Relation indexRelation,
|
Relation indexRelation,
|
||||||
IndexInfo *indexInfo,
|
IndexInfo *indexInfo,
|
||||||
bool isprimary,
|
|
||||||
bool isreindex,
|
bool isreindex,
|
||||||
bool parallel)
|
bool parallel)
|
||||||
{
|
{
|
||||||
|
@ -3702,7 +3696,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
|
||||||
|
|
||||||
/* Initialize the index and rebuild */
|
/* Initialize the index and rebuild */
|
||||||
/* Note: we do not need to re-establish pkey setting */
|
/* Note: we do not need to re-establish pkey setting */
|
||||||
index_build(heapRelation, iRel, indexInfo, false, true, true);
|
index_build(heapRelation, iRel, indexInfo, true, true);
|
||||||
}
|
}
|
||||||
PG_CATCH();
|
PG_CATCH();
|
||||||
{
|
{
|
||||||
|
|
|
@ -1168,7 +1168,7 @@ DefineIndex(Oid relationId,
|
||||||
indexInfo->ii_BrokenHotChain = false;
|
indexInfo->ii_BrokenHotChain = false;
|
||||||
|
|
||||||
/* Now build the index */
|
/* Now build the index */
|
||||||
index_build(rel, indexRelation, indexInfo, stmt->primary, false, true);
|
index_build(rel, indexRelation, indexInfo, false, true);
|
||||||
|
|
||||||
/* Close both the relations, but keep the locks */
|
/* Close both the relations, but keep the locks */
|
||||||
table_close(rel, NoLock);
|
table_close(rel, NoLock);
|
||||||
|
|
|
@ -107,7 +107,6 @@ extern void FormIndexDatum(IndexInfo *indexInfo,
|
||||||
extern void index_build(Relation heapRelation,
|
extern void index_build(Relation heapRelation,
|
||||||
Relation indexRelation,
|
Relation indexRelation,
|
||||||
IndexInfo *indexInfo,
|
IndexInfo *indexInfo,
|
||||||
bool isprimary,
|
|
||||||
bool isreindex,
|
bool isreindex,
|
||||||
bool parallel);
|
bool parallel);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue