Re: The usual sequential scan, but with LIMIT ! - Mailing list pgsql-performance

From Pierre-Frédéric Caillaud
Subject Re: The usual sequential scan, but with LIMIT !
Date
Msg-id opsdynxsrqcq72hf@musicbox
Whole thread Raw
In response to Re: The usual sequential scan, but with LIMIT !  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: The usual sequential scan, but with LIMIT !  (Gaetano Mendola <mendola@bigfoot.com>)
List pgsql-performance
    Yes, you're right as usual.
    I had not thought about playing with ORDER BY on a field which has only
one value in the result set.


> If you write it as
>     SELECT WHERE topic_id=2 ORDER BY topic_id DESC,id DESC.
> then an index on (topic_id, id) will work fine.  The mixed ASC/DESC
> ordering is not compatible with the index.


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: [ADMIN] TOAST tables, cannot truncate
Next
From: Gaetano Mendola
Date:
Subject: Re: The usual sequential scan, but with LIMIT !