Commit 1d71f3c8 authored by Peter Eisentraut's avatar Peter Eisentraut

Improve confusing variable names

The prototype calls the second argument of
pgstat_progress_update_multi_param() "index", and some callers name
their local variable that way.  But when the surrounding code deals
with index relations, this is confusing, and in at least one case
shadowed another variable that is referring to an index relation.
Adjust those call sites to have clearer local variable naming, similar
to existing callers in indexcmds.c.
parent 4ad31bb2
...@@ -486,17 +486,17 @@ _bt_spools_heapscan(Relation heap, Relation index, BTBuildState *buildstate, ...@@ -486,17 +486,17 @@ _bt_spools_heapscan(Relation heap, Relation index, BTBuildState *buildstate,
* values set by table_index_build_scan * values set by table_index_build_scan
*/ */
{ {
const int index[] = { const int progress_index[] = {
PROGRESS_CREATEIDX_TUPLES_TOTAL, PROGRESS_CREATEIDX_TUPLES_TOTAL,
PROGRESS_SCAN_BLOCKS_TOTAL, PROGRESS_SCAN_BLOCKS_TOTAL,
PROGRESS_SCAN_BLOCKS_DONE PROGRESS_SCAN_BLOCKS_DONE
}; };
const int64 val[] = { const int64 progress_vals[] = {
buildstate->indtuples, buildstate->indtuples,
0, 0 0, 0
}; };
pgstat_progress_update_multi_param(3, index, val); pgstat_progress_update_multi_param(3, progress_index, progress_vals);
} }
/* okay, all heap tuples are spooled */ /* okay, all heap tuples are spooled */
......
...@@ -3045,7 +3045,7 @@ index_build(Relation heapRelation, ...@@ -3045,7 +3045,7 @@ index_build(Relation heapRelation,
/* Set up initial progress report status */ /* Set up initial progress report status */
{ {
const int index[] = { const int progress_index[] = {
PROGRESS_CREATEIDX_PHASE, PROGRESS_CREATEIDX_PHASE,
PROGRESS_CREATEIDX_SUBPHASE, PROGRESS_CREATEIDX_SUBPHASE,
PROGRESS_CREATEIDX_TUPLES_DONE, PROGRESS_CREATEIDX_TUPLES_DONE,
...@@ -3053,13 +3053,13 @@ index_build(Relation heapRelation, ...@@ -3053,13 +3053,13 @@ index_build(Relation heapRelation,
PROGRESS_SCAN_BLOCKS_DONE, PROGRESS_SCAN_BLOCKS_DONE,
PROGRESS_SCAN_BLOCKS_TOTAL PROGRESS_SCAN_BLOCKS_TOTAL
}; };
const int64 val[] = { const int64 progress_vals[] = {
PROGRESS_CREATEIDX_PHASE_BUILD, PROGRESS_CREATEIDX_PHASE_BUILD,
PROGRESS_CREATEIDX_SUBPHASE_INITIALIZE, PROGRESS_CREATEIDX_SUBPHASE_INITIALIZE,
0, 0, 0, 0 0, 0, 0, 0
}; };
pgstat_progress_update_multi_param(6, index, val); pgstat_progress_update_multi_param(6, progress_index, progress_vals);
} }
/* /*
...@@ -3351,19 +3351,19 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) ...@@ -3351,19 +3351,19 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
int save_nestlevel; int save_nestlevel;
{ {
const int index[] = { const int progress_index[] = {
PROGRESS_CREATEIDX_PHASE, PROGRESS_CREATEIDX_PHASE,
PROGRESS_CREATEIDX_TUPLES_DONE, PROGRESS_CREATEIDX_TUPLES_DONE,
PROGRESS_CREATEIDX_TUPLES_TOTAL, PROGRESS_CREATEIDX_TUPLES_TOTAL,
PROGRESS_SCAN_BLOCKS_DONE, PROGRESS_SCAN_BLOCKS_DONE,
PROGRESS_SCAN_BLOCKS_TOTAL PROGRESS_SCAN_BLOCKS_TOTAL
}; };
const int64 val[] = { const int64 progress_vals[] = {
PROGRESS_CREATEIDX_PHASE_VALIDATE_IDXSCAN, PROGRESS_CREATEIDX_PHASE_VALIDATE_IDXSCAN,
0, 0, 0, 0 0, 0, 0, 0
}; };
pgstat_progress_update_multi_param(5, index, val); pgstat_progress_update_multi_param(5, progress_index, progress_vals);
} }
/* Open and lock the parent heap relation */ /* Open and lock the parent heap relation */
...@@ -3420,17 +3420,17 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot) ...@@ -3420,17 +3420,17 @@ validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
/* Execute the sort */ /* Execute the sort */
{ {
const int index[] = { const int progress_index[] = {
PROGRESS_CREATEIDX_PHASE, PROGRESS_CREATEIDX_PHASE,
PROGRESS_SCAN_BLOCKS_DONE, PROGRESS_SCAN_BLOCKS_DONE,
PROGRESS_SCAN_BLOCKS_TOTAL PROGRESS_SCAN_BLOCKS_TOTAL
}; };
const int64 val[] = { const int64 progress_vals[] = {
PROGRESS_CREATEIDX_PHASE_VALIDATE_SORT, PROGRESS_CREATEIDX_PHASE_VALIDATE_SORT,
0, 0 0, 0
}; };
pgstat_progress_update_multi_param(3, index, val); pgstat_progress_update_multi_param(3, progress_index, progress_vals);
} }
tuplesort_performsort(state.tuplesort); tuplesort_performsort(state.tuplesort);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment