mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Add the ability to create indexes 'concurrently', that is, without
blocking concurrent writes to the table. Greg Stark, with a little help from Tom Lane.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.124 2006/08/05 00:22:49 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.125 2006/08/25 04:06:50 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -138,6 +138,18 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, RelOptInfo *rel)
|
||||
indexRelation = index_open(indexoid, lmode);
|
||||
index = indexRelation->rd_index;
|
||||
|
||||
/*
|
||||
* Ignore invalid indexes, since they can't safely be used for
|
||||
* queries. Note that this is OK because the data structure
|
||||
* we are constructing is only used by the planner --- the
|
||||
* executor still needs to insert into "invalid" indexes!
|
||||
*/
|
||||
if (!index->indisvalid)
|
||||
{
|
||||
index_close(indexRelation, NoLock);
|
||||
continue;
|
||||
}
|
||||
|
||||
info = makeNode(IndexOptInfo);
|
||||
|
||||
info->indexoid = index->indexrelid;
|
||||
|
Reference in New Issue
Block a user