From a2822fb9337a21f98ac4ce850bb4145acf47ca27 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 7 Oct 2011 20:13:02 -0400 Subject: Support index-only scans using the visibility map to avoid heap fetches. When a btree index contains all columns required by the query, and the visibility map shows that all tuples on a target heap page are visible-to-all, we don't need to fetch that heap page. This patch depends on the previous patches that made the visibility map reliable. There's a fair amount left to do here, notably trying to figure out a less chintzy way of estimating the cost of an index-only scan, but the core functionality seems ready to commit. Robert Haas and Ibrar Ahmed, with some previous work by Heikki Linnakangas. --- src/backend/tcop/postgres.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 19d94b252c2..976a832135e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3065,7 +3065,7 @@ set_debug_options(int debug_flag, GucContext context, GucSource source) bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source) { - char *tmp = NULL; + const char *tmp = NULL; switch (arg[0]) { @@ -3075,6 +3075,9 @@ set_plan_disabling_options(const char *arg, GucContext context, GucSource source case 'i': /* indexscan */ tmp = "enable_indexscan"; break; + case 'o': /* indexonlyscan */ + tmp = "enable_indexonlyscan"; + break; case 'b': /* bitmapscan */ tmp = "enable_bitmapscan"; break; -- cgit v1.2.3