Re: Update 3 columns w/ 1 function calc 3 values?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: paallen(at)attglobal(dot)net
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Update 3 columns w/ 1 function calc 3 values?
Date: 2006-10-03 17:19:56
Message-ID: 20061003171956.GB5744@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Oct 03, 2006 at 14:55:55 +0000,
paallen(at)attglobal(dot)net wrote:
> 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
>
> What should I do to speed this up. What is the
> best way to update 3 columns from one function
> call. 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.

Why is the data in three different tables? It is unusual to not have all
coordinates in the same table using one column per coordinate.

If you need to update 3 tables, you will need 3 update statements.
Doing all of the updates in a single transaction will help.
If possible doing all of the updates for each coordinate table in one command
will help. To do that you would need the data to be coming from data already
in the database.
Chnaging the design of your database so that the coordinates are all in the
same table (assuming that is possible) would be a good idea.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Worky Workerson 2006-10-03 17:32:22 Updating from table with multiple possibilities
Previous Message Bruno Wolff III 2006-10-03 17:11:25 Re: How to FindNearest