pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: Versionning (was: Whole-row comparison)
Date: Fri, 1 Jun 2007 14:51:25 -0400
Message-ID: <20070601185125.GJ24299@phlogiston.dyndns.org> (raw)
In-Reply-To: <CCC9DCA122011F4CA593F6A548BFFBD362FCFE@esebe111.NOE.Nokia.com>
References: <CCC9DCA122011F4CA593F6A548BFFBD354D259@esebe111.NOE.Nokia.com>
	<473557.7523.qm@web31803.mail.mud.yahoo.com>
	<CCC9DCA122011F4CA593F6A548BFFBD354D260@esebe111.NOE.Nokia.com>
	<CCC9DCA122011F4CA593F6A548BFFBD362FCF9@esebe111.NOE.Nokia.com>
	<20070601174711.GH24299@phlogiston.dyndns.org>
	<CCC9DCA122011F4CA593F6A548BFFBD362FCFE@esebe111.NOE.Nokia.com>

On Fri, Jun 01, 2007 at 09:07:10PM +0300, christian.roche.ext@nsn.com wrote:
>  
> Hi Andrew,
> 
> I must admit I don't really understand what you say.  I don't know what
> SRF stand for, and what you say about generic case is not clear to me,
> sorry.

Sorry, it stands for set returning function.  I thought someone
upthread suggested that instead of a view.

> and the following statement would be optimized:
> 
> UPDATE param_table SET ver_id = xxx;
> SELECT * FROM bsc_view WHERE obj_id = yyy; 
> 
> which would not be the case would I have used a multi-row function.
> 
> Does this make sense ?

Yes, but I don't think it's true.  Because you change the value of
ver_id all the time, the actual result can't be collapsed to a
constant, so you end up having to execute the query with the
additional value, and you still have to plan that.  The same thing is
true of a function, which will have its plan prepared the first time
you execute it.  (I could be wrong about this; I suppose the only way
would be to try it.)

A
-- 
Andrew Sullivan  | ajs@crankycanuck.ca
However important originality may be in some fields, restraint and 
adherence to procedure emerge as the more significant virtues in a 
great many others.   --Alain de Botton



view thread (6+ messages)  latest in thread

Message-ID: <20070601185125.GJ24299@phlogiston.dyndns.org>
Permalink:  ../20070601185125.GJ24299@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070601185125.GJ24299@phlogiston.dyndns.org

 · 

reply

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: ajs@crankycanuck.ca
  Subject: Re: Versionning (was: Whole-row comparison)
  In-Reply-To: <20070601185125.GJ24299@phlogiston.dyndns.org>

* 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