Re: Slow queries when ORDER BY ... DESC with table inheritance (no index scan backwards)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "DANG Trieu" <tdang(at)miranda(dot)com>
Cc: tv(at)fuzzy(dot)cz, pgsql-general(at)postgresql(dot)org
Subject: Re: Slow queries when ORDER BY ... DESC with table inheritance (no index scan backwards)
Date: 2008-11-18 18:41:49
Message-ID: 22664.1227033709@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"DANG Trieu" <tdang(at)miranda(dot)com> writes:
> On the "abstract" table (event):
> gsmlog3_30=# explain analyze select * from event where timestamp >
> 1226952050683 order by timestamp desc limit 10;

Turning on constraint exclusion might help here, if you have appropriate
check constraints for the range of timestamp attached to all the tables.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael P. Soulier 2008-11-18 18:43:53 apparent deadlock
Previous Message Tom Lane 2008-11-18 18:37:53 Re: No serial type