Skip site navigation (1) Skip section navigation (2)

Re: slow cursor

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Sriram Dandapani <sdandapani(at)counterpane(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: slow cursor
Date: 2006-04-24 17:42:29
Message-ID: 20060424174229.GE48010@pervasive.com (view raw or flat)
Thread:
Lists: pgsql-admin
Ok, so why does that require row-by-row processing?

On Thu, Apr 20, 2006 at 08:45:57PM -0700, Sriram Dandapani wrote:
> Yes..all of it is in one transaction as there is a window of record ids
> that need to be processed in 1 transaction. Data inflow is very
> voluminous appx 1 million every 15 minutes and the goal is to create
> aggregate tables on the fly (the alternative is to use nightly
> aggregates). 
> 
> -----Original Message-----
> From: Jim C. Nasby [mailto:jnasby(at)pervasive(dot)com] 
> Sent: Thursday, April 20, 2006 7:36 PM
> To: Sriram Dandapani
> Cc: pgsql-admin(at)postgresql(dot)org
> Subject: Re: [ADMIN] slow cursor
> 
> On Mon, Apr 17, 2006 at 07:07:54AM -0700, Sriram Dandapani wrote:
> > 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 records and speed
> up
> > the process. I still need to do the record by record processing
> 
> Not likely. Are you at least doing all this inside a transaction?
> -- 
> Jim C. Nasby, Sr. Engineering Consultant      jnasby(at)pervasive(dot)com
> Pervasive Software      http://pervasive.com    work: 512-231-6117
> vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby(at)pervasive(dot)com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

In response to

pgsql-admin by date

Next:From: Jim C. NasbyDate: 2006-04-24 17:51:15
Subject: Re: Autovacuuming
Previous:From: Jim C. NasbyDate: 2006-04-24 17:30:17
Subject: Re: recovery problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group