Re: CURSOR slowes down a WHERE clause 100 times?

From: Niccolo Rigacci <niccolo(at)rigacci(dot)org>
To: John A Meinel <john(at)arbash-meinel(dot)com>
Cc: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: CURSOR slowes down a WHERE clause 100 times?
Date: 2005-07-07 07:41:47
Message-ID: 20050707074147.GA16360@rigacci.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> >Can the CURSOR on JOIN affects so heavly the WHERE clause? I
> >suspect that - with the CURSOR - a sequential scan is performed
> >on the entire data set for each fetched record...
> >
> >Any idea?
> >
> >
> What does it say if you do "EXPLAIN ANALYZE SELECT..." both with and
> without the cursor?
> It may not say much for the cursor, but I think you can explain analyze
> the fetch statements.

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"...

Thanks

--
Niccolo Rigacci
Firenze - Italy

War against Iraq? Not in my name!

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Niccolo Rigacci 2005-07-07 08:13:27 Re: CURSOR slowes down a WHERE clause 100 times?
Previous Message Josh Berkus 2005-07-07 00:40:12 Re: Data Warehousing Tuning