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

Commita349b86

Browse files
Move heaprel struct field next to index rel field.
Commit61b313e added a heaprel struct member to IndexVacuumInfo, butplaced it last. Move the heaprel struct member next to the index structmember to improve the code's readability.Author: Peter Geoghegan <pg@bowt.ie>Discussion:https://postgr.es/m/CAH2-WznG=TV6S9d3VA=y0vBHbXwnLs9_LLdiML=aNJuHeriwxg@mail.gmail.com
1 parente7e7da2 commita349b86

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

‎src/backend/access/heap/vacuumlazy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,13 +2711,13 @@ lazy_vacuum_one_index(Relation indrel, IndexBulkDeleteResult *istat,
27112711
LVSavedErrInfosaved_err_info;
27122712

27132713
ivinfo.index=indrel;
2714+
ivinfo.heaprel=vacrel->rel;
27142715
ivinfo.analyze_only= false;
27152716
ivinfo.report_progress= false;
27162717
ivinfo.estimated_count= true;
27172718
ivinfo.message_level=DEBUG2;
27182719
ivinfo.num_heap_tuples=reltuples;
27192720
ivinfo.strategy=vacrel->bstrategy;
2720-
ivinfo.heaprel=vacrel->rel;
27212721

27222722
/*
27232723
* Update error traceback information.
@@ -2760,14 +2760,14 @@ lazy_cleanup_one_index(Relation indrel, IndexBulkDeleteResult *istat,
27602760
LVSavedErrInfosaved_err_info;
27612761

27622762
ivinfo.index=indrel;
2763+
ivinfo.heaprel=vacrel->rel;
27632764
ivinfo.analyze_only= false;
27642765
ivinfo.report_progress= false;
27652766
ivinfo.estimated_count=estimated_count;
27662767
ivinfo.message_level=DEBUG2;
27672768

27682769
ivinfo.num_heap_tuples=reltuples;
27692770
ivinfo.strategy=vacrel->bstrategy;
2770-
ivinfo.heaprel=vacrel->rel;
27712771

27722772
/*
27732773
* Update error traceback information.

‎src/backend/catalog/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3358,13 +3358,13 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
33583358
* Scan the index and gather up all the TIDs into a tuplesort object.
33593359
*/
33603360
ivinfo.index=indexRelation;
3361+
ivinfo.heaprel=heapRelation;
33613362
ivinfo.analyze_only= false;
33623363
ivinfo.report_progress= true;
33633364
ivinfo.estimated_count= true;
33643365
ivinfo.message_level=DEBUG2;
33653366
ivinfo.num_heap_tuples=heapRelation->rd_rel->reltuples;
33663367
ivinfo.strategy=NULL;
3367-
ivinfo.heaprel=heapRelation;
33683368

33693369
/*
33703370
* Encode TIDs as int8 values for the sort, rather than directly sorting

‎src/backend/commands/analyze.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,12 +707,12 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
707707
IndexVacuumInfoivinfo;
708708

709709
ivinfo.index=Irel[ind];
710+
ivinfo.heaprel=onerel;
710711
ivinfo.analyze_only= true;
711712
ivinfo.estimated_count= true;
712713
ivinfo.message_level=elevel;
713714
ivinfo.num_heap_tuples=onerel->rd_rel->reltuples;
714715
ivinfo.strategy=vac_strategy;
715-
ivinfo.heaprel=onerel;
716716

717717
stats=index_vacuum_cleanup(&ivinfo,NULL);
718718

‎src/backend/commands/vacuumparallel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ parallel_vacuum_process_one_index(ParallelVacuumState *pvs, Relation indrel,
836836
istat=&(indstats->istat);
837837

838838
ivinfo.index=indrel;
839+
ivinfo.heaprel=pvs->heaprel;
839840
ivinfo.analyze_only= false;
840841
ivinfo.report_progress= false;
841842
ivinfo.message_level=DEBUG2;
842843
ivinfo.estimated_count=pvs->shared->estimated_count;
843844
ivinfo.num_heap_tuples=pvs->shared->reltuples;
844845
ivinfo.strategy=pvs->bstrategy;
845-
ivinfo.heaprel=pvs->heaprel;
846846

847847
/* Update error traceback information */
848848
pvs->indname=pstrdup(RelationGetRelationName(indrel));

‎src/include/access/genam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ typedef struct IndexBuildResult
4444
typedefstructIndexVacuumInfo
4545
{
4646
Relationindex;/* the index being vacuumed */
47+
Relationheaprel;/* the heap relation the index belongs to */
4748
boolanalyze_only;/* ANALYZE (without any actual vacuum) */
4849
boolreport_progress;/* emit progress.h status reports */
4950
boolestimated_count;/* num_heap_tuples is an estimate */
5051
intmessage_level;/* ereport level for progress messages */
5152
doublenum_heap_tuples;/* tuples remaining in heap */
5253
BufferAccessStrategystrategy;/* access strategy for reads */
53-
Relationheaprel;/* the heap relation the index belongs to */
5454
}IndexVacuumInfo;
5555

5656
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp