Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita50aaa7

Browse files
author
Hiroshi Inoue
committed
Change reindex command to work properly with gist/hash/rtree
1 parentab3dc66 commita50aaa7

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.50 2000/01/19 23:54:46 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.51 2000/03/01 05:39:20 inoue Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -284,12 +284,13 @@ gistbuild(Relation heap,
284284
{
285285
Oidhrelid=RelationGetRelid(heap);
286286
Oidirelid=RelationGetRelid(index);
287+
boolinplace=IsReindexProcessing();
287288

288289
heap_close(heap,NoLock);
289290
index_close(index);
290-
UpdateStats(hrelid,nh,true);
291-
UpdateStats(irelid,ni,false);
292-
if (oldPred!=NULL)
291+
UpdateStats(hrelid,nh,inplace);
292+
UpdateStats(irelid,ni,inplace);
293+
if (oldPred!=NULL&& !inplace)
293294
{
294295
if (ni==nh)
295296
pred=NULL;

‎src/backend/access/hash/hash.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.35 2000/01/26 05:55:55 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.36 2000/03/01 05:39:22 inoue Exp $
1212
*
1313
* NOTES
1414
* This file contains only the public interface routines.
@@ -242,12 +242,13 @@ hashbuild(Relation heap,
242242
{
243243
Oidhrelid=RelationGetRelid(heap);
244244
Oidirelid=RelationGetRelid(index);
245+
boolinplace=IsReindexProcessing();
245246

246247
heap_close(heap,NoLock);
247248
index_close(index);
248-
UpdateStats(hrelid,nhtups,true);
249-
UpdateStats(irelid,nitups,false);
250-
if (oldPred!=NULL)
249+
UpdateStats(hrelid,nhtups,inplace);
250+
UpdateStats(irelid,nitups,inplace);
251+
if (oldPred!=NULL&& !inplace)
251252
{
252253
if (nitups==nhtups)
253254
pred=NULL;

‎src/backend/access/rtree/rtree.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.43 2000/01/26 05:56:00 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.44 2000/03/01 05:39:23 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -261,12 +261,13 @@ rtbuild(Relation heap,
261261
{
262262
Oidhrelid=RelationGetRelid(heap);
263263
Oidirelid=RelationGetRelid(index);
264+
boolinplace=IsReindexProcessing();
264265

265266
heap_close(heap,NoLock);
266267
index_close(index);
267-
UpdateStats(hrelid,nh,true);
268-
UpdateStats(irelid,ni,false);
269-
if (oldPred!=NULL)
268+
UpdateStats(hrelid,nh,inplace);
269+
UpdateStats(irelid,ni,inplace);
270+
if (oldPred!=NULL&& !inplace)
270271
{
271272
if (ni==nh)
272273
pred=NULL;

‎src/backend/catalog/index.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.106 2000/02/25 02:58:47 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.107 2000/03/01 05:39:24 inoue Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -2057,7 +2057,6 @@ reindex_index(Oid indexId, bool force)
20572057
OidheapId,procId,accessMethodId;
20582058
Node*oldPred=NULL;
20592059
PredInfo*predInfo;
2060-
List*cnfPred=NULL;
20612060
AttrNumber*attributeNumberA;
20622061
FuncIndexInfofInfo,*funcInfo=NULL;
20632062
inti,numberOfAttributes;
@@ -2096,8 +2095,8 @@ reindex_index(Oid indexId, bool force)
20962095
pfree(predString);
20972096
}
20982097
predInfo= (PredInfo*)palloc(sizeof(PredInfo));
2099-
predInfo->pred= (Node*)cnfPred;
2100-
predInfo->oldPred=oldPred;
2098+
predInfo->pred= (Node*)oldPred;
2099+
predInfo->oldPred=NULL;
21012100

21022101
/* Assign Index keys to attributes array */
21032102
attributeNumberA= (AttrNumber*)palloc(numberOfAttributes*sizeof(AttrNumber));
@@ -2247,5 +2246,5 @@ reindex_relation(Oid relid, bool force)
22472246
setRelhasindexInplace(relid, true, false);
22482247
}
22492248
SetReindexProcessing(old);
2250-
returntrue;
2249+
returnreindexed;
22512250
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp