Re: Unused index influencing sequential scan plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Unused index influencing sequential scan plan
Date: 2012-10-18 16:44:27
Message-ID: 102.1350578667@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Thom Brown <thom(at)linux(dot)com> writes:
> I've created a test table containing 21 million random dates and
> times, but I get wildly different results when I introduce a
> functional index then ANALYSE again, even though it doesn't use the
> index:

As Peter said, the existence of the index causes ANALYZE to gather stats
about the expression, which will affect rowcount estimates whether or
not the planner chooses to use the index.

> And as a side note, how come it's impossible to get the planner to use
> an index-only scan to satisfy the query (disabling sequential and
> regular index scans)?

Implementation restriction - we don't yet have a way to match index-only
scans to expressions.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Thom Brown 2012-10-18 16:46:12 Re: Unused index influencing sequential scan plan
Previous Message Craig James 2012-10-18 16:39:45 Re: Two identical systems, radically different performance