Re: Rule recompilation

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: Rule recompilation
Дата
Msg-id 200107121900.f6CJ0iM05109@jupiter.us.greatbridge.com
обсуждение исходный текст
Ответ на RE: Rule recompilation  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
Ответы Re: Rule recompilation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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
justholds  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.
Plusrecursively 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
solvedif   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@Yahoo.com #



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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Rule recompilation
Следующее
От: Jean-Michel POURE
Дата:
Сообщение: Dependency tracking