Re: Update 3 columns w/ 1 function calc 3 values? - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: Update 3 columns w/ 1 function calc 3 values?
Date
Msg-id 20061003171956.GB5744@wolff.to
Whole thread Raw
In response to Update 3 columns w/ 1 function calc 3 values?  (paallen@attglobal.net)
List pgsql-sql
On Tue, Oct 03, 2006 at 14:55:55 +0000, paallen@attglobal.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.


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: How to FindNearest
Next
From: "Worky Workerson"
Date:
Subject: Updating from table with multiple possibilities