pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
clear function cache (WAS: SQL function inlining)
5+ messages / 3 participants
[nested] [flat]

* clear function cache (WAS: SQL function inlining)
@ 2005-03-24 13:32  Enrico Weigelt <weigelt@metux.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Enrico Weigelt @ 2005-03-24 13:32 UTC (permalink / raw)
  To: pgsql-performance

* Tom Lane <tgl@sss.pgh.pa.us> wrote:

<big_snip>

BTW: is it possible to explicitly clear the cache for immutable 
functions ?

I'd like to use immutable functions for really often lookups like 
fetching a username by uid and vice versa. The queried tables 
change very rarely, but when they change is quite unpredictable.


thx
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: clear function cache (WAS: SQL function inlining)
@ 2005-03-24 13:42  Alvaro Herrera <alvherre@dcc.uchile.cl>
  parent: Enrico Weigelt <weigelt@metux.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2005-03-24 13:42 UTC (permalink / raw)
  To: Enrico Weigelt <weigelt@metux.de>; +Cc: pgsql-performance

On Thu, Mar 24, 2005 at 02:32:48PM +0100, Enrico Weigelt wrote:

> BTW: is it possible to explicitly clear the cache for immutable 
> functions ?

What cache?  There is no caching of function results.

> I'd like to use immutable functions for really often lookups like 
> fetching a username by uid and vice versa. The queried tables 
> change very rarely, but when they change is quite unpredictable.

Maybe you should use a stable function if you fear we'll having function
result caching without you noticing.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Aprende a avergonzarte más ante ti que ante los demás" (Demócrito)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: clear function cache (WAS: SQL function inlining)
@ 2005-03-24 14:12  Enrico Weigelt <weigelt@metux.de>
  parent: Alvaro Herrera <alvherre@dcc.uchile.cl>
  0 siblings, 1 reply; 5+ messages in thread

From: Enrico Weigelt @ 2005-03-24 14:12 UTC (permalink / raw)
  To: pgsql-performance

* Alvaro Herrera <alvherre@dcc.uchile.cl> wrote:
> On Thu, Mar 24, 2005 at 02:32:48PM +0100, Enrico Weigelt wrote:
> 
> > BTW: is it possible to explicitly clear the cache for immutable 
> > functions ?
> 
> What cache?  There is no caching of function results.

Not ? So what's immutable for ?

<snip>
> > I'd like to use immutable functions for really often lookups like 
> > fetching a username by uid and vice versa. The queried tables 
> > change very rarely, but when they change is quite unpredictable.
> 
> Maybe you should use a stable function if you fear we'll having function
> result caching without you noticing.

hmm, this makes more real evaluations necessary than w/ immuatable.
AFAIK stable functions have to be evaluated once per query, and the 
results are not cached between several queries.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: clear function cache (WAS: SQL function inlining)
@ 2005-03-24 14:58  Stephan Szabo <sszabo@megazone.bigpanda.com>
  parent: Enrico Weigelt <weigelt@metux.de>
  0 siblings, 1 reply; 5+ messages in thread

From: Stephan Szabo @ 2005-03-24 14:58 UTC (permalink / raw)
  To: Enrico Weigelt <weigelt@metux.de>; +Cc: pgsql-performance


On Thu, 24 Mar 2005, Enrico Weigelt wrote:

> * Alvaro Herrera <alvherre@dcc.uchile.cl> wrote:
> > On Thu, Mar 24, 2005 at 02:32:48PM +0100, Enrico Weigelt wrote:
> >
> > > BTW: is it possible to explicitly clear the cache for immutable
> > > functions ?
> >
> > What cache?  There is no caching of function results.
>
> Not ? So what's immutable for ?

For knowing that you can do things like use it in a functional index and
I think for things like constant folding in a prepared plan.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: clear function cache (WAS: SQL function inlining)
@ 2005-04-15 20:40  Enrico Weigelt <weigelt@metux.de>
  parent: Stephan Szabo <sszabo@megazone.bigpanda.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Enrico Weigelt @ 2005-04-15 20:40 UTC (permalink / raw)
  To: pgsql-performance

* Stephan Szabo <sszabo@megazone.bigpanda.com> wrote:
> 
> On Thu, 24 Mar 2005, Enrico Weigelt wrote:
> 
> > * Alvaro Herrera <alvherre@dcc.uchile.cl> wrote:
> > > On Thu, Mar 24, 2005 at 02:32:48PM +0100, Enrico Weigelt wrote:
> > >
> > > > BTW: is it possible to explicitly clear the cache for immutable
> > > > functions ?
> > >
> > > What cache?  There is no caching of function results.
> >
> > Not ? So what's immutable for ?
> 
> For knowing that you can do things like use it in a functional index and
> I think for things like constant folding in a prepared plan.

So when can I expect the function to be reevaluated ? 
Next query ? Next session ? Random time ?

cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-04-15 20:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-24 13:32 clear function cache (WAS: SQL function inlining) Enrico Weigelt <weigelt@metux.de>
2005-03-24 13:42 ` Alvaro Herrera <alvherre@dcc.uchile.cl>
2005-03-24 14:12   ` Enrico Weigelt <weigelt@metux.de>
2005-03-24 14:58     ` Stephan Szabo <sszabo@megazone.bigpanda.com>
2005-04-15 20:40       ` Enrico Weigelt <weigelt@metux.de>

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