Re: CURSOR slowes down a WHERE clause 100 times?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Niccolo Rigacci <niccolo(at)rigacci(dot)org>
Cc: John A Meinel <john(at)arbash-meinel(dot)com>, Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: CURSOR slowes down a WHERE clause 100 times?
Date: 2005-07-07 13:59:33
Message-ID: 7484.1120744773@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Niccolo Rigacci <niccolo(at)rigacci(dot)org> writes:
> How can I EXPLAIN ANALYZE a cursor like this?

> BEGIN;
> DECLARE mycursor BINARY CURSOR FOR
> SELECT ...
> FETCH ALL IN mycursor;
> END;

> I tried to put EXPLAIN ANALYZE in front of the SELECT and in
> front of the FETCH, but I got two "syntax error"...

Just FYI, you can't EXPLAIN ANALYZE this, but you can EXPLAIN it:

EXPLAIN DECLARE x CURSOR FOR ...

so you can at least find out what the plan is.

It might be cool to support EXPLAIN ANALYZE FETCH --- not sure what that
would take.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-07-07 14:02:25 Re: How to speed up delete
Previous Message Dawid Kuroczko 2005-07-07 13:48:06 Re: Surprizing performances for Postgres on Centrino