Re: [PERFORM] Slow cursor

2011-10-26 Thread Andres Freund
Hi, On Wednesday 26 Oct 2011 14:43:08 Cezariusz Marek wrote: > Is there any known problem with slow cursors in PostgreSQL 8.4.5? > > I have a following query, which is slow (on my database it takes 11 seconds > to execute), probably should be rewritten, but it doesn't matter here. The > problem i

Re: [PERFORM] Slow cursor

2011-10-26 Thread Cezariusz Marek
Gregg Jaskiewicz wrote: > Do you really need to query the catalogues ? That on its own is not a > good idea if you want something to run fast and frequently. I know, but I've used it just to show the problem with cursors. I have the same problem with other slow queries, which execute within x sec

Re: [PERFORM] Slow cursor

2011-10-26 Thread Gregg Jaskiewicz
Do you really need to query the catalogues ? That on its own is not a good idea if you want something to run fast and frequently. -- GJ -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-p

[PERFORM] Slow cursor

2011-10-26 Thread Cezariusz Marek
Is there any known problem with slow cursors in PostgreSQL 8.4.5? I have a following query, which is slow (on my database it takes 11 seconds to execute), probably should be rewritten, but it doesn't matter here. The problem is, that in cursor, each fetch takes much longer (even few minutes!),

Re: [PERFORM] slow cursor

2006-04-17 Thread Luckys
This is one thing that I always try to avoid, a single INSERT INTO...SELECT ...FROM or single UPDATE is always faster compared to looping the same within a cursor, unless its inevitable.   regards, Luckys.  On 4/17/06, Sriram Dandapani <[EMAIL PROTECTED]> wrote: Hi   I have a cursor that fetches

[PERFORM] slow cursor

2006-04-17 Thread Sriram Dandapani
Hi   I have a cursor that fetches 150K rows and updates or inserts a table with 150K rows.   It takes several minutes for the process to complete (about 15 minutes). The select by itself (without cursor) gets all rows in 15 seconds.   Is there a way to optimize the cursor to fetch all