From: Niccolo Rigacci <niccolo@rigacci.org>
To: John A Meinel <john@arbash-meinel.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: CURSOR slowes down a WHERE clause 100 times?
Date: Thu, 7 Jul 2005 09:41:47 +0200
Message-ID: <20050707074147.GA16360@rigacci.org> (raw)
In-Reply-To: <42CC4D1C.9040606@arbash-meinel.com>
References: <20050706211946.GA3460@rigacci.org>
<42CC4D1C.9040606@arbash-meinel.com>
> >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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: niccolo@rigacci.org, john@arbash-meinel.com
Subject: Re: CURSOR slowes down a WHERE clause 100 times?
In-Reply-To: <20050707074147.GA16360@rigacci.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox