Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a95307b6
Commit
a95307b6
authored
Mar 27, 2009
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teach reindex_index() to clear pg_index.indcheckxmin when possible.
Greg Stark, slightly modified by me.
parent
c1dcaa86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/backend/catalog/index.c
src/backend/catalog/index.c
+10
-4
No files found.
src/backend/catalog/index.c
View file @
a95307b6
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.31
3 2009/03/24 20:17:12
tgl Exp $
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.31
4 2009/03/27 15:57:11
tgl Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -2243,6 +2243,7 @@ reindex_index(Oid indexId)
pg_index
;
Oid
heapId
;
bool
inplace
;
IndexInfo
*
indexInfo
;
HeapTuple
indexTuple
;
Form_pg_index
indexForm
;
...
...
@@ -2293,8 +2294,6 @@ reindex_index(Oid indexId)
PG_TRY
();
{
IndexInfo
*
indexInfo
;
/* Suppress use of the target index while rebuilding it */
SetReindexProcessing
(
heapId
,
indexId
);
...
...
@@ -2333,6 +2332,10 @@ reindex_index(Oid indexId)
* If the index is marked invalid or not ready (ie, it's from a failed
* CREATE INDEX CONCURRENTLY), we can now mark it valid. This allows
* REINDEX to be used to clean up in such cases.
*
* We can also reset indcheckxmin, because we have now done a
* non-concurrent index build, *except* in the case where index_build
* found some still-broken HOT chains.
*/
pg_index
=
heap_open
(
IndexRelationId
,
RowExclusiveLock
);
...
...
@@ -2343,10 +2346,13 @@ reindex_index(Oid indexId)
elog
(
ERROR
,
"cache lookup failed for index %u"
,
indexId
);
indexForm
=
(
Form_pg_index
)
GETSTRUCT
(
indexTuple
);
if
(
!
indexForm
->
indisvalid
||
!
indexForm
->
indisready
)
if
(
!
indexForm
->
indisvalid
||
!
indexForm
->
indisready
||
(
indexForm
->
indcheckxmin
&&
!
indexInfo
->
ii_BrokenHotChain
))
{
indexForm
->
indisvalid
=
true
;
indexForm
->
indisready
=
true
;
if
(
!
indexInfo
->
ii_BrokenHotChain
)
indexForm
->
indcheckxmin
=
false
;
simple_heap_update
(
pg_index
,
&
indexTuple
->
t_self
,
indexTuple
);
CatalogUpdateIndexes
(
pg_index
,
indexTuple
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment