Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4E1299FB26B for ; Tue, 3 Oct 2006 12:19:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 62409-04 for ; Tue, 3 Oct 2006 12:19:22 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by postgresql.org (Postfix) with ESMTP id B791B9FA4F4 for ; Tue, 3 Oct 2006 12:19:21 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so624907ugc for ; Tue, 03 Oct 2006 08:19:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=iag1HKAS/4LSm+mPUOem6aiRFkHwJSqQ3U01RBRBKwb+l02zIXkdRP5YFn0uPyrDNIDstjuN7H4f2q0kRwZupktibgBHfgwLNpvD2BaQ8Vv7W9UYPnB9CmoWFJIxm+YWMeuKOgXlJ00rt+bgQ7mIQLpuyCJ3ZcZnd7STjF/8BbQ= Received: by 10.49.90.4 with SMTP id s4mr960822nfl; Tue, 03 Oct 2006 08:19:19 -0700 (PDT) Received: by 10.48.217.1 with HTTP; Tue, 3 Oct 2006 08:19:19 -0700 (PDT) Message-ID: Date: Tue, 3 Oct 2006 12:19:19 -0300 From: "=?ISO-8859-1?Q?William_Leite_Ara=FAjo?=" To: "paallen@attglobal.net" Subject: Re: Update 3 columns w/ 1 function calc 3 values? Cc: pgsql-sql@postgresql.org In-Reply-To: <20061003145559.C55369FB26B@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1608_33014753.1159888759632" References: <20061003145559.C55369FB26B@postgresql.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.496 tagged_above=0 required=5 tests=HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/23 X-Sequence-Number: 26412 ------=_Part_1608_33014753.1159888759632 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 2006/10/3, paallen@attglobal.net : > > Hi all, > > I am moving some of my old MS Access functions to > plpgsql. > > My function was made to return coordinates, X,Y,Z > for a point along a curved line. So it is not the > fastest of functions because it has to call and > query data from 3 different tables. I used to > just create 3 wrapper functions for my main > function which would return the x, y, and z values > seperately but that requires the main function to > be called 3 seperate times. So here is my bottle > neck. Of course I need to update +50,000 records. > > What should I do to speed this up. What is the > best way to update 3 columns from one function > call. It's realy very hard say something without the involving tables schema= . You can: - change the function to return x,y,z in one call only ? - join the tables? - what is the function language? In MSACCESS I once rig the function to > cycle through the records with a curser but that > was slow and would crap out due to the shear number. > > Thanks, > > Phil > --=20 William Leite Ara=FAjo ------=_Part_1608_33014753.1159888759632 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 2006/10/3, paallen@attglobal.net <paallen@attglobal.net&g= t;:
Hi all,

I am moving some of my old MS Access functions to
plpgsql= .

My function was made to return coordinates, X,Y,Z
for a point a= long a curved line.  So it is not the
fastest of functions bec= ause it has to call and
query data from 3 different tables.  I used to
just create= 3 wrapper functions for my main
function which would return the x, y, a= nd z values
seperately but that requires the main function to
be call= ed 3 seperate times.  So here is my bottle
neck.  Of course I need to update +50,000 records.

Wha= t should I do to speed this up.  What is the
best way to updat= e 3 columns from one function
call.  

&nb= sp;    It's realy very hard say something without the involv= ing tables schema.=20
     You can:
     &nb= sp;  - change the function to return x,y,z in one call only ?
 = ;       - join the tables?
  &nb= sp;     - what is the function language?
 
In MSACCESS I once rig the function to
cycle through the records with a = curser but that
was slow and would crap out due to the shear number.
=
Thanks,

Phil



--= =20
William Leite Ara=FAjo
------=_Part_1608_33014753.1159888759632--