Re: Rule recompilation

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
Cc: "'Jan Wieck'" <JanWieck(at)Yahoo(dot)com>, PostgreSQL HACKERS <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Rule recompilation
Date: 2001-07-12 19:00:44
Message-ID: 200107121900.f6CJ0iM05109@jupiter.us.greatbridge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mikheev, Vadim wrote:
> > > Why is it possible in Oracle' world? -:)
> >
> > Because of there limited features?
>
> And now we limit our additional advanced features -:)
>
> > Think about a language like PL/Tcl. At the time you call a
> > script for execution, you cannot even be sure that the Tcl
> > bytecode compiler parsed anything, so how will you ever know
> > the complete set of objects referenced from this function?
> >
> > And PL/pgSQL? We don't prepare all the statements into SPI
> > plans at compile time. We wait until the separate branches
> > are needed, so how do you know offhand here?
>
> At the time of creation function body could be parsed and referenced
> objects stored in system table (or function could be marked as dirty
> and referenced objects would stored at first compilation and after
> each subsequent successful after-dirtied-compilation).
> Isn't it possible for PL/_ANY_L_ too?

Nonononono!

PL/Tcl is a very good example for that. To load a function,
basically a "proc" command is executed in a Tcl interpreter.
But execution of Tcl's "proc" command doesn't cause the
bytecode compiler to kick in and actually parse the
procedures body. So until the first actual call of the
function, the Tcl interpreter just holds a string for the
body. Now a procedure body in Tcl is basically a list of
commands with possible sublists. On call, only the topmost
level of this list hierarchy is parsed and compiled, command
per command. Plus recursively those sublists, needed for this
invocation.

You cannot control Tcl's bytecode compiler from the outside.
There's no API for that. And Tcl is a dynamic language. A
function might execute dynamic code found in some user table?

Since we don't save bytecode for PL objects, these all are
IMHO runtime dependencies and most of them could be solved if
we fix SPI to deal with it correctly.

Jan

--

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

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-07-12 19:04:02 Re: Re: Strangeness in xid allocation / snapshot setup
Previous Message Tom Lane 2001-07-12 18:55:42 Re: Rule recompilation