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 General > Nested IMMUTABL...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15799 of 17437
Post > Topic >>

Nested IMMUTABLE functions

by "Peter" <peter@[EMAIL PROTECTED] > Jun 12, 2008 at 09:50 AM

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
 




 2 Posts in Topic:
Nested IMMUTABLE functions
"Peter" <pet  2008-06-12 09:50:20 
Re: Nested IMMUTABLE functions
joris@[EMAIL PROTECTED]   2008-06-14 14:44:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Nov 22 16:32:58 CST 2008.