Re: How to get the total number of rows returned by query when using a cursor?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Egor Shipovalov" <pgsql_list(at)eonline(dot)ru>
Cc: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to get the total number of rows returned by query when using a cursor?
Date: 2003-09-23 15:42:58
Message-ID: 17549.1064331778@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Egor Shipovalov" <pgsql_list(at)eonline(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2003-09-23 15:50:58 Re: About GPL and proprietary software
Previous Message Egor Shipovalov 2003-09-23 15:38:37 Re: How to get the total number of rows returned by query when using a cursor?