Re: The usual sequential scan, but with LIMIT !

From: Pierre-Frédéric Caillaud <lists(at)boutiquenumerique(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: The usual sequential scan, but with LIMIT !
Date: 2004-09-07 14:30:54
Message-ID: opsdynxsrqcq72hf@musicbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-09-07 14:36:33 Re: error: insert has more expressions than target column
Previous Message Richard Huxton 2004-09-07 14:27:09 Re: error: insert has more expressions than target column

Browse pgsql-performance by date

  From Date Subject
Next Message Ron St-Pierre 2004-09-07 16:20:07 Re: [PERFORM] Table UPDATE is too slow
Previous Message Tom Lane 2004-09-07 14:16:28 Re: [PERFORM] TOAST tables, cannot truncate