Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id B7391475BBD for ; Tue, 19 Mar 2002 10:28:40 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g2JFShS29148; Tue, 19 Mar 2002 10:28:43 -0500 (EST) To: Kelly Burkhart Cc: pgsql-sql@postgresql.org Subject: Re: optimizer tuning/forcing correct index use In-reply-to: <02031907224907.00735@krbdev> References: <02031907224907.00735@krbdev> Comments: In-reply-to Kelly Burkhart message dated "Tue, 19 Mar 2002 07:22:49 -0600" Date: Tue, 19 Mar 2002 10:28:42 -0500 Message-ID: <29145.1016551722@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200203/238 X-Sequence-Number: 7117 Kelly Burkhart 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