Re: Way to use count() and LIMIT? - Mailing list pgsql-general

From Tom Lane
Subject Re: Way to use count() and LIMIT?
Date
Msg-id 1164.1008782005@sss.pgh.pa.us
Whole thread Raw
In response to Re: Way to use count() and LIMIT?  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-general
"Greg Sabino Mullane" <greg@turnstep.com> writes:
> Still, it seems that there should be a way to grab the information,
> especially if you have an "ORDER BY" clause in your query - after
> all, that means at some point, postgres knows how many records
> matched before it ORDERS and LIMITS them.

Not necessarily; it could be using an indexscan to do the ordering.

            regards, tom lane

pgsql-general by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Way to use count() and LIMIT?
Next
From: "Ian Harding"
Date:
Subject: Can't use subselect in check constraint