I modified postgresql 8.1 for its optimization part. Basically I reset
the whole memory context
after query optimization (but store the query plan in top level memory
context so it is not lost).

Later at certain time, I match queries to the pre-computed query plans
(to avoid re-compiling the whole query again).  My problem is that
when optimizing
the queries, the functions (date conversion, say)  is cached into
memory (current memory context). However, this cached information is
not part of the query plan generated, so when I reset memory after
query optimization, this information is gone.  As a result, I get 
"cache lookup failed for function ..."  error from inside 
fmgr_info_cxt_security( ) in fmgr.c

If I wish that heap memory is never released, or i wish the heap is
never used for caching function definitions, how should I do that?  or
is there any alternatives?

thanks a lot!

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to