summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.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/utils/misc/guc.c
parentf207bb0b8f13999c91b405a2e6c8526225470816 (diff)
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/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 4c6d6486623..326e773b25f 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -196,7 +196,6 @@ static bool check_autovacuum_max_workers(int *newval, void **extra, GucSource so
static bool check_max_wal_senders(int *newval, void **extra, GucSource source);
static bool check_autovacuum_work_mem(int *newval, void **extra, GucSource source);
static bool check_effective_io_concurrency(int *newval, void **extra, GucSource source);
-static void assign_effective_io_concurrency(int newval, void *extra);
static void assign_pgstat_temp_directory(const char *newval, void *extra);
static bool check_application_name(char **newval, void **extra, GucSource source);
static void assign_application_name(const char *newval, void *extra);
@@ -2882,7 +2881,7 @@ static struct config_int ConfigureNamesInt[] =
0,
#endif
0, MAX_IO_CONCURRENCY,
- check_effective_io_concurrency, assign_effective_io_concurrency, NULL
+ check_effective_io_concurrency, NULL, NULL
},
{
@@ -11457,36 +11456,14 @@ check_max_worker_processes(int *newval, void **extra, GucSource source)
static bool
check_effective_io_concurrency(int *newval, void **extra, GucSource source)
{
-#ifdef USE_PREFETCH
- double new_prefetch_pages;
-
- if (ComputeIoConcurrency(*newval, &new_prefetch_pages))
- {
- int *myextra = (int *) guc_malloc(ERROR, sizeof(int));
-
- *myextra = (int) rint(new_prefetch_pages);
- *extra = (void *) myextra;
-
- return true;
- }
- else
- return false;
-#else
+#ifndef USE_PREFETCH
if (*newval != 0)
{
GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise().");
return false;
}
- return true;
-#endif /* USE_PREFETCH */
-}
-
-static void
-assign_effective_io_concurrency(int newval, void *extra)
-{
-#ifdef USE_PREFETCH
- target_prefetch_pages = *((int *) extra);
#endif /* USE_PREFETCH */
+ return true;
}
static void