Re: Unused index influencing sequential scan plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Unused index influencing sequential scan plan
Date
Msg-id 102.1350578667@sss.pgh.pa.us
Whole thread Raw
In response to Unused index influencing sequential scan plan  (Thom Brown <thom@linux.com>)
Responses Re: Unused index influencing sequential scan plan  (Thom Brown <thom@linux.com>)
List pgsql-performance
Thom Brown <thom@linux.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


pgsql-performance by date:

Previous
From: Craig James
Date:
Subject: Re: Two identical systems, radically different performance
Next
From: Thom Brown
Date:
Subject: Re: Unused index influencing sequential scan plan