Re: optimizer tuning/forcing correct index use - Mailing list pgsql-sql

From Tom Lane
Subject Re: optimizer tuning/forcing correct index use
Date
Msg-id 29145.1016551722@sss.pgh.pa.us
Whole thread Raw
In response to optimizer tuning/forcing correct index use  (Kelly Burkhart <kelly@tradebotsystems.com>)
List pgsql-sql
Kelly Burkhart <kelly@tradebotsystems.com> writes:
> The critical part is driving the fill table query from a sequential scan
> rather than a scan of fill_ak2.

Have you done an ANALYZE or VACUUM ANALYZE lately?  If so, what do you
get from

select * from pg_stats where tablename = 'fill';
select * from pg_class where relname = 'fill';

Offhand I am guessing that the table is fairly well ordered by fill_ts
and the planner is underestimating the effects of this.  There is a
provision in there to try to account for data ordering, but it's new
code in 7.2 and doubtless still needs refinement.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Andrew G. Hammond"
Date:
Subject: Re: How to create crude report with psql and/or plpgsql
Next
From: Kelly Burkhart
Date:
Subject: Re: optimizer tuning/forcing correct index use