From: M Simms <grim@argh.demon.co.uk>
To: michael.j.davis@tvguide.com
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Update problem I cannot work out
Date: Sun, 2 May 1999 13:24:16 +0100 (BST)
Message-ID: <199905021224.NAA15135@argh.demon.co.uk> (raw)
In-Reply-To: <93C04F1F5173D211A27900105AA8FCFC145461@lambic.prevuenet.com>
>
> Try something like:
>
> Create function new_function(value_data_type)
> 'Select sum(t1.var1) from t1 where t1.var2 = $1' LANGUAGE
> 'sql';
>
> update t2 set var1=t2.var1+new_function(t2.var2);
>
*snip*
Hi, thanks for replying.
My reply to this is the question, that as each function contains a
select, is this technically a single pass.
I get the feeling there will be tremendous overhead on this theory with a
large dataset, in comparison to a single query that does the
update. Can anyone comment on how much slower this could be (although
obviously if there is no way to do it in a single query then there is
no choice)?
Thanks
M Simms
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: grim@argh.demon.co.uk, michael.j.davis@tvguide.com
Subject: Re: [SQL] Update problem I cannot work out
In-Reply-To: <199905021224.NAA15135@argh.demon.co.uk>
References: <93C04F1F5173D211A27900105AA8FCFC145461@lambic.prevuenet.com> <199905021224.NAA15135@argh.demon.co.uk>
* 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