From 1aba62ec635f5852bc45ce65482366e541e61ff5 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 8 Sep 2015 12:51:42 -0300 Subject: Allow per-tablespace effective_io_concurrency Per discussion, nowadays it is possible to have tablespaces that have wildly different I/O characteristics from others. Setting different effective_io_concurrency parameters for those has been measured to improve performance. Author: Julien Rouhaud Reviewed by: Andres Freund --- src/backend/access/common/reloptions.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/backend/access/common/reloptions.c') diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 7479d40b67b..d817eba61bb 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -254,6 +254,19 @@ static relopt_int intRelOpts[] = }, -1, 64, MAX_KILOBYTES }, + { + { + "effective_io_concurrency", + "Number of simultaneous requests that can be handled efficiently by the disk subsystem.", + RELOPT_KIND_TABLESPACE, + AccessExclusiveLock + }, +#ifdef USE_PREFETCH + -1, 0, MAX_IO_CONCURRENCY +#else + 0, 0, 0 +#endif + }, /* list terminator */ {{NULL}} @@ -1438,7 +1451,8 @@ tablespace_reloptions(Datum reloptions, bool validate) int numoptions; static const relopt_parse_elt tab[] = { {"random_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, random_page_cost)}, - {"seq_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, seq_page_cost)} + {"seq_page_cost", RELOPT_TYPE_REAL, offsetof(TableSpaceOpts, seq_page_cost)}, + {"effective_io_concurrency", RELOPT_TYPE_INT, offsetof(TableSpaceOpts, effective_io_concurrency)} }; options = parseRelOptions(reloptions, validate, RELOPT_KIND_TABLESPACE, -- cgit v1.2.3