aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeBitmapHeapscan.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2020-03-16 11:43:18 +1300
committerThomas Munro <tmunro@postgresql.org>2020-03-16 17:14:26 +1300
commitb09ff53667ffc986371ec8ffa372916ad460220d (patch)
tree511cc574dc192acb6cd7dba4be35968ba188b961 /src/backend/executor/nodeBitmapHeapscan.c
parentf207bb0b8f13999c91b405a2e6c8526225470816 (diff)
downloadpostgresql-b09ff53667ffc986371ec8ffa372916ad460220d.tar.gz
postgresql-b09ff53667ffc986371ec8ffa372916ad460220d.zip
Simplify the effective_io_concurrency setting.
The effective_io_concurrency GUC and equivalent tablespace option were previously passed through a formula based on a theory about RAID spindles and probabilities, to arrive at the number of pages to prefetch in bitmap heap scans. Tomas Vondra, Andres Freund and others argued that it was anachronistic and hard to justify, and commit 558a9165e08 already started down the path of bypassing it in new code. We agreed to drop that logic and use the value directly. For the default setting of 1, there is no change in effect. Higher settings can be converted from the old meaning to the new with: select round(sum(OLD / n::float)) from generate_series(1, OLD) s(n); We might want to consider renaming the GUC before the next release given the change in meaning, but it's not clear that many users had set it very carefully anyway. That decision is deferred for now. Discussion: https://postgr.es/m/CA%2BhUKGJUw08dPs_3EUcdO6M90GnjofPYrWp4YSLaBkgYwS-AqA%40mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeBitmapHeapscan.c')
-rw-r--r--src/backend/executor/nodeBitmapHeapscan.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index ae8a11da304..726d3a2d9a4 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -707,7 +707,6 @@ ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
{
BitmapHeapScanState *scanstate;
Relation currentRelation;
- int io_concurrency;
/* check for unsupported flags */
Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
@@ -737,8 +736,6 @@ ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
scanstate->prefetch_iterator = NULL;
scanstate->prefetch_pages = 0;
scanstate->prefetch_target = 0;
- /* may be updated below */
- scanstate->prefetch_maximum = target_prefetch_pages;
scanstate->pscan_len = 0;
scanstate->initialized = false;
scanstate->shared_tbmiterator = NULL;
@@ -794,20 +791,11 @@ ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
ExecInitQual(node->bitmapqualorig, (PlanState *) scanstate);
/*
- * Determine the maximum for prefetch_target. If the tablespace has a
- * specific IO concurrency set, use that to compute the corresponding
- * maximum value; otherwise, we already initialized to the value computed
- * by the GUC machinery.
+ * Maximum number of prefetches for the tablespace if configured, otherwise
+ * the current value of the effective_io_concurrency GUC.
*/
- io_concurrency =
+ scanstate->prefetch_maximum =
get_tablespace_io_concurrency(currentRelation->rd_rel->reltablespace);
- if (io_concurrency != effective_io_concurrency)
- {
- double maximum;
-
- if (ComputeIoConcurrency(io_concurrency, &maximum))
- scanstate->prefetch_maximum = rint(maximum);
- }
scanstate->ss.ss_currentRelation = currentRelation;