Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Nested IMMUTABL...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3524 of 3661
Post > Topic >>

Nested IMMUTABLE functions

by "Peter" <peter@[EMAIL PROTECTED] > Jun 11, 2008 at 05:21 PM

I have two immutable Pl/PG funcs - func A takes a parameter X, looks up 
related value Y from a table and p***** Y to func B. Now, if I do
something 
like

select A(field_x) from bigtable

it will, of course call A for every single row since paramater is
changing. 
However, it also calls func B for every row even though most (actually
all) 
related values Y are the same!

Is this by design, or flaw in optimizer? I thought immutable funcs with
the 
same arguments are only called once within a scope of single query, and
that 
'select A(...)' should have counted as single query, right?

This stuff is killing me... func B is small, all table lookups optimized
to 
the hilt but still I'm taking major performance hit as it's called 
hundreds/thousands of times.

Any ideas?

Thx,
Peter
 




 1 Posts in Topic:
Nested IMMUTABLE functions
"Peter" <pet  2008-06-11 17:21:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 6:33:41 CDT 2008.