Re: Returning the total number of rows as a separate column when using limit - Mailing list pgsql-sql

From Tom Lane
Subject Re: Returning the total number of rows as a separate column when using limit
Date
Msg-id 18728.1194272302@sss.pgh.pa.us
Whole thread Raw
In response to Returning the total number of rows as a separate column when using limit  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: Returning the total number of rows as a separate column when using limit  (Andreas Joseph Krogh <andreak@officenet.no>)
List pgsql-sql
Andreas Joseph Krogh <andreak@officenet.no> writes:
> AFAICS the information about the *total* number of rows is in the "result" 
> somehow. When I execute a "limit 1" query with EXPLAIN ANALYZE, I se the 
> total number of columns in "rows=200819", so the information is there.

That's only an estimate.  Since the query doesn't get executed to
completion thanks to the LIMIT, Postgres really has no idea whether
the estimate is accurate.
        regards, tom lane


pgsql-sql by date:

Previous
From: Kenneth Gonsalves
Date:
Subject: changing encoding of a postgres database
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: Returning the total number of rows as a separate column when using limit