> >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! ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend