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

Commit1d71f3c

Browse files
committed
Improve confusing variable names
The prototype calls the second argument ofpgstat_progress_update_multi_param() "index", and some callers nametheir local variable that way. But when the surrounding code dealswith index relations, this is confusing, and in at least one caseshadowed another variable that is referring to an index relation.Adjust those call sites to have clearer local variable naming, similarto existing callers in indexcmds.c.
1 parent4ad31bb commit1d71f3c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,17 +486,17 @@ _bt_spools_heapscan(Relation heap, Relation index, BTBuildState *buildstate,
486486
* values set by table_index_build_scan
487487
*/
488488
{
489-
constintindex[]= {
489+
constintprogress_index[]= {
490490
PROGRESS_CREATEIDX_TUPLES_TOTAL,
491491
PROGRESS_SCAN_BLOCKS_TOTAL,
492492
PROGRESS_SCAN_BLOCKS_DONE
493493
};
494-
constint64val[]= {
494+
constint64progress_vals[]= {
495495
buildstate->indtuples,
496496
0,0
497497
};
498498

499-
pgstat_progress_update_multi_param(3,index,val);
499+
pgstat_progress_update_multi_param(3,progress_index,progress_vals);
500500
}
501501

502502
/* okay, all heap tuples are spooled */

‎src/backend/catalog/index.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,21 +3045,21 @@ index_build(Relation heapRelation,
30453045

30463046
/* Set up initial progress report status */
30473047
{
3048-
constintindex[]= {
3048+
constintprogress_index[]= {
30493049
PROGRESS_CREATEIDX_PHASE,
30503050
PROGRESS_CREATEIDX_SUBPHASE,
30513051
PROGRESS_CREATEIDX_TUPLES_DONE,
30523052
PROGRESS_CREATEIDX_TUPLES_TOTAL,
30533053
PROGRESS_SCAN_BLOCKS_DONE,
30543054
PROGRESS_SCAN_BLOCKS_TOTAL
30553055
};
3056-
constint64val[]= {
3056+
constint64progress_vals[]= {
30573057
PROGRESS_CREATEIDX_PHASE_BUILD,
30583058
PROGRESS_CREATEIDX_SUBPHASE_INITIALIZE,
30593059
0,0,0,0
30603060
};
30613061

3062-
pgstat_progress_update_multi_param(6,index,val);
3062+
pgstat_progress_update_multi_param(6,progress_index,progress_vals);
30633063
}
30643064

30653065
/*
@@ -3351,19 +3351,19 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
33513351
intsave_nestlevel;
33523352

33533353
{
3354-
constintindex[]= {
3354+
constintprogress_index[]= {
33553355
PROGRESS_CREATEIDX_PHASE,
33563356
PROGRESS_CREATEIDX_TUPLES_DONE,
33573357
PROGRESS_CREATEIDX_TUPLES_TOTAL,
33583358
PROGRESS_SCAN_BLOCKS_DONE,
33593359
PROGRESS_SCAN_BLOCKS_TOTAL
33603360
};
3361-
constint64val[]= {
3361+
constint64progress_vals[]= {
33623362
PROGRESS_CREATEIDX_PHASE_VALIDATE_IDXSCAN,
33633363
0,0,0,0
33643364
};
33653365

3366-
pgstat_progress_update_multi_param(5,index,val);
3366+
pgstat_progress_update_multi_param(5,progress_index,progress_vals);
33673367
}
33683368

33693369
/* Open and lock the parent heap relation */
@@ -3420,17 +3420,17 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
34203420

34213421
/* Execute the sort */
34223422
{
3423-
constintindex[]= {
3423+
constintprogress_index[]= {
34243424
PROGRESS_CREATEIDX_PHASE,
34253425
PROGRESS_SCAN_BLOCKS_DONE,
34263426
PROGRESS_SCAN_BLOCKS_TOTAL
34273427
};
3428-
constint64val[]= {
3428+
constint64progress_vals[]= {
34293429
PROGRESS_CREATEIDX_PHASE_VALIDATE_SORT,
34303430
0,0
34313431
};
34323432

3433-
pgstat_progress_update_multi_param(3,index,val);
3433+
pgstat_progress_update_multi_param(3,progress_index,progress_vals);
34343434
}
34353435
tuplesort_performsort(state.tuplesort);
34363436

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp