Re: shouldn't postgres know the numer of rows in a (sorted) - Mailing list pgsql-general

From Richard Huxton
Subject Re: shouldn't postgres know the numer of rows in a (sorted)
Date
Msg-id 437B2F2B.90402@archonet.com
Whole thread Raw
In response to shouldn't postgres know the numer of rows in a (sorted) result-set before returning the first row?  (Thies C Arntzen <thies@thieso.net>)
Responses Re: shouldn't postgres know the numer of rows in a (sorted) result-set before returning the first row?  ("Thies C. Arntzen" <thies@thieso.net>)
List pgsql-general
Thies C Arntzen wrote:
> i would be interested in getting this uncorrected count "after sort"
> but  "before first row" in query (a). so in a fresh DB with no
> updates/deletes this would be the correct count, and i could avoid the
> very expensive  (b).

You don't say what applicaton language you are using, but most offer a
pg_num_rows() interface which tells you how many results are in the
recordset you have fetched.

Your best bet to learn more is to read whatever documentation comes with
your client library.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Tsearch2: casting text to tsquery
Next
From: Alexander Presber
Date:
Subject: Re: Tsearch2: casting text to tsquery