Re: CURSOR slowes down a WHERE clause 100 times? - Mailing list pgsql-performance

From Niccolo Rigacci
Subject Re: CURSOR slowes down a WHERE clause 100 times?
Date
Msg-id 20050707074147.GA16360@rigacci.org
Whole thread Raw
In response to Re: CURSOR slowes down a WHERE clause 100 times?  (John A Meinel <john@arbash-meinel.com>)
Responses Re: CURSOR slowes down a WHERE clause 100 times?
List 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!

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Data Warehousing Tuning
Next
From: Niccolo Rigacci
Date:
Subject: Re: CURSOR slowes down a WHERE clause 100 times?