Re: ORDER BY, LIMIT and indexes

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Claudio Freire <klaussfreire(at)gmail(dot)com>
Cc: Ivan Voras <ivoras(at)freebsd(dot)org>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: ORDER BY, LIMIT and indexes
Date: 2013-08-06 00:20:18
Message-ID: CAB7nPqRi=9EUa3PEOoaUggh8MHpHBSEjrghGFjdpH=NQKfEBFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Aug 6, 2013 at 8:25 AM, Claudio Freire <klaussfreire(at)gmail(dot)com>wrote:

> On Mon, Aug 5, 2013 at 8:04 PM, Ivan Voras <ivoras(at)freebsd(dot)org> wrote:
> > SELECT * FROM table ORDER BY id DESC LIMIT 10 OFFSET 10
> >
> > SELECT * FROM table WHERE active ORDER BY id DESC LIMIT 10 OFFSET 10
>
> Did you try explain?
>
And did you run ANALYZE on your table to be sure that you generate correct
plans?
--
Michael

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2013-08-06 01:22:16 Re: ORDER BY, LIMIT and indexes
Previous Message Claudio Freire 2013-08-05 23:25:58 Re: ORDER BY, LIMIT and indexes