Re: [HACKERS] Cache query (PREPARE/EXECUTE)

Поиск
Список
Период
Сортировка
Искать
От
wieck@debis.com (Jan Wieck)
Тема
Re: [HACKERS] Cache query (PREPARE/EXECUTE)
Дата
Msg-id
m12Ni7o-0003kgC@orion.SAPserv.Hamburg.dsh.de
Ответ на
Список
Дерево обсуждения
Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Tom Lane <tgl@sss.pgh.pa.us>
RE: [HACKERS] Cache query (PREPARE/EXECUTE) "Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: [HACKERS] Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
RE: [HACKERS] Cache query (PREPARE/EXECUTE) "Hiroshi Inoue" <Inoue@tpf.co.jp>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) wieck@debis.com (Jan Wieck)
RE: [HACKERS] Cache query (PREPARE/EXECUTE) "Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: [HACKERS] Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) wieck@debis.com (Jan Wieck)
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) wieck@debis.com (Jan Wieck)
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) wieck@debis.com (Jan Wieck)
[HACKERS] Cache query implemented Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query implemented Peter Eisentraut <peter_e@gmx.net>
Re: [HACKERS] Cache query implemented Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query implemented Karel Zak - Zakkr <zakkr@zf.jcu.cz>
RE: [HACKERS] Cache query implemented "Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: [HACKERS] Cache query implemented Karel Zak - Zakkr <zakkr@zf.jcu.cz>
RE: [HACKERS] Cache query implemented "Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: [HACKERS] Cache query implemented Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Don Baccus <dhogaza@pacifier.com>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) The Hermit Hacker <scrappy@hub.org>
Re: [HACKERS] Cache query (PREPARE/EXECUTE) Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Karel wrote:

> > Why is memory context per plan bad ?
>
>  One context is more simple.
   I  don't  see  much complexity difference between one context   per plan vs. one context for  all.  At  least  if  we  do  it   transparently inside of SPI_saveplan() and SPI_freeplan().

>  We talking about a *cache*. If exist interface for this cache and
>  all operations are with copy/freeObject it not has restriction.
>
>  For how action it will restriction?
   No restrictions I can see.
   But I think one context per plan is still better, since first   there is no leakage/multiref  problem.  Second,  there  is  a   performance   difference   between   explicitly   pfree()'ing   hundreds of small allocations (in freeObject() traverse), and   just  destroying  a  context.  The  changes  I  made  to  the   MemoryContextAlloc stuff for v6.5 (IIRC), using bigger blocks   incl.  padding/reuse  for small allocations, caused a speedup   of 5+% for the entire regression test. This was only  because   it  uses lesser real calls to malloc()/free() and the context   destruction does not need to process  a  huge  list  of  all,   however small allocations anymore.  It simply throws away all   blocks now.
   This  time,  we  talk  about  a   more   complex,   recursive   freeObject(), switch()'ing for every node type into separate,   per object  type  specific  functions,  pfree()'ing  all  the   little  chunks.   So  there  is  at  least  a  difference  in   first/second-level RAM cache rows required. And if  that  can   simply  be  avoided by using one context per plan, I vote for   1by1.
   Then  again,  copyObject/freeObject   must   be   fixed   WRT   leakage/multiref anyway.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #



В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата:
Сообщение: Changes in 7.0
От: Ross J. Reedstrom
Дата:
FAQ