Re: index scan backward plan question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Kevin Murphy <murphy(at)genome(dot)chop(dot)edu>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: index scan backward plan question
Date: 2006-03-21 23:36:56
Message-ID: 6814.1142984216@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Neil Conway <neilc(at)samurai(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris 2006-03-21 23:51:19 Re: W3C XML Schema -> PostgreSQL?
Previous Message Tom Lane 2006-03-21 23:11:12 Re: [GENERAL] A real currency type