Re: How to get the total number of rows returned by query when using a cursor? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to get the total number of rows returned by query when using a cursor?
Date
Msg-id 17549.1064331778@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to get the total number of rows returned by query when using a cursor?  ("Egor Shipovalov" <pgsql_list@eonline.ru>)
Responses Re: How to get the total number of rows returned by query when using a cursor?  ("Egor Shipovalov" <pgsql_list@eonline.ru>)
List pgsql-general
"Egor Shipovalov" <pgsql_list@eonline.ru> writes:
> The interesting thing is that some queries are tens (!) of times slower with
> LIMIT that without. These contain a number of joins on subselects. If you're
> interested, I'll post examples.

Sounds like the planner is misestimating costs and choosing the wrong plan.
Please show examples (EXPLAIN ANALYZE for same query with and without
LIMIT would be useful).

            regards, tom lane

pgsql-general by date:

Previous
From: "Egor Shipovalov"
Date:
Subject: Re: How to get the total number of rows returned by query when using a cursor?
Next
From: Robert Treat
Date:
Subject: Re: About GPL and proprietary software