0

I'm trying to compare a query's performance with and without an index. I tried setting enable_indexscan to False, but the query planner still uses an index (EXPLAIN SELECT ... shows exactly the same result). What am I doing wrong?

Here's what I'm running:

SET enable_indexscan = False;
EXPLAIN SELECT * FROM table WHERE indexed_column='some_value';

Query plan (irrespective of enable_indexscan):

enter image description here

lfk
  • 2,423
  • 6
  • 29
  • 46
  • *What am I doing wrong?* ... not posting the query plans, for a start. Edit your question to add, then comment here. – Craig Ringer Nov 01 '17 at 01:43
  • Added. The table is partitioned. I've added a date condition to make it shorter (otherwise it would be 92 lines). – lfk Nov 01 '17 at 02:49

1 Answers1

4

enable_indexscan only turns off simple index scans.

You should also:

SET enable_indexonlyscan = off;
SET enable_bitmapscan = off;
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778