Re: index scan backward plan question - Mailing list pgsql-general

From Tom Lane
Subject Re: index scan backward plan question
Date
Msg-id 6814.1142984216@sss.pgh.pa.us
Whole thread Raw
In response to Re: index scan backward plan question  (Neil Conway <neilc@samurai.com>)
List pgsql-general
Neil Conway <neilc@samurai.com> writes:
>> ->  Index Scan Backward using merged_weight_date_idx on merged
>> (cost=0.00..31295593.98 rows=141839 width=229) (actual
>> time=3.888..10380.783 rows=500 loops=1)

> The mis-estimation of the result set of the index scan is clearly a
> problem -- have you run ANALYZE recently?

I'm not sure the above is a misestimation --- the actual rowcount is
going to be restricted by the LIMIT node (which I'm betting is actually
LIMIT 50 OFFSET 450, though that's strictly a guess from the rowcounts).
It would be useful to know how many rows match the query without any
LIMIT though.

> Otherwise, please provide the queries that trigger the problem and the
> relevant schema definitions.

Yes, giving people only the EXPLAIN output without the queries or table
definitions (in particular, the available indexes) is not a recipe for
getting quality advice.

            regards, tom lane

pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: index scan backward plan question
Next
From: Chris
Date:
Subject: Re: W3C XML Schema -> PostgreSQL?