From: Bruno Wolff III <bruno@wolff.to>
To: paallen@attglobal.net
Cc: pgsql-sql@postgresql.org
Subject: Re: Update 3 columns w/ 1 function calc 3 values?
Date: Tue, 3 Oct 2006 12:19:56 -0500
Message-ID: <20061003171956.GB5744@wolff.to> (raw)
In-Reply-To: <20061003145559.C55369FB26B@postgresql.org>
References: <20061003145559.C55369FB26B@postgresql.org>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, paallen@attglobal.net
Subject: Re: Update 3 columns w/ 1 function calc 3 values?
In-Reply-To: <20061003171956.GB5744@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox