pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <janwieck@yahoo.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Jan Wieck <janwieck@yahoo.com>
Cc: jack <datactrl@tpg.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: call the same pl/pgsql procedure twice in the same connection
Date: Tue, 23 Apr 2002 12:31:45 -0400 (EDT)
Message-ID: <200204231631.g3NGVjI02096@saturn.janwieck.net> (raw)
In-Reply-To: <200204231615.g3NGFXa10160@candle.pha.pa.us>

Bruce Momjian wrote:
> Jan Wieck wrote:
> > Bruce Momjian wrote:
> > > Jan Wieck wrote:
> > > > Bruce Momjian wrote:
> > > > >
> > > > > Jan, instead of doing cache invalidation to fix temporary tables, can we
> > > > > disable cached plans for functions that use temporary tables?
> > > >
> > > >     I  was  thinking  of  a different approach. Enhancing the SPI
> > > >     manager to detect if a plan uses  temporary  objects  and  to
> > > >     remember  the  original  querystring  in the SPI_plan. Having
> > > >     callbacks when temp object  beeing  destroyed  into  the  SPI
> > > >     manager,  causing  it to reparse and plan on the next call to
> > > >     SPI_execp() would do it for everything that uses SPI.
> > >
> > > I was merely proposing that preventing caching of functions ueing temp
> > > tables may be easier than trying to invalidation them on temp table
> > > destruction.
> >
> >     It's neat to say "preventing caching of functions using ...",
> >     now tell in detail how you detect that a function "is"  using
> >     a  temp table?  No, I don't mean how "you" can detect it, how
> >     can the PL/pgSQL parser or executor detect it.  And  when  do
> >     you  detect  it?  Remember  that  PL/pgSQL  has  delayed  SPI
> >     preparation?
> >
> >     Second, it doesn't really look smart to me to prevent  saving
> >     of  all  query  plans  just  because  one of them uses a temp
> >     table.
>
> Well, I assume you could spin through the plan at save time and look at
> every relation reference to see if it is a temp table.

Bruce,

    you are really good at making things sound simple by stopping
    half way through.

    Your  assumption  is  exactly  my  "detect  if  a  plan  uses
    temporary objects". No go on, what exactly are you doing with
    the information that the plan uses a temp table?

    And BTW, since you are the one who invented temp tables,  how
    does someone detect a temp table?


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #





view thread (12+ messages)  latest in thread

Message-ID: <200204231631.g3NGVjI02096@saturn.janwieck.net>
Permalink:  ../200204231631.g3NGVjI02096@saturn.janwieck.net/
Also on:    postgresql.org/message-id/200204231631.g3NGVjI02096@saturn.janwieck.net

 · 

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 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: janwieck@yahoo.com, pgman@candle.pha.pa.us, datactrl@tpg.com.au
  Subject: Re: call the same pl/pgsql procedure twice in the same connection
  In-Reply-To: <200204231631.g3NGVjI02096@saturn.janwieck.net>
  References: <200204231615.g3NGFXa10160@candle.pha.pa.us> <200204231631.g3NGVjI02096@saturn.janwieck.net>

* 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