> I've got a UDF that is used on the publishing side of a data warehouse:
> when the data is headed out to a mart. It works fine for sets of a few
[quoted text clipped - 28 lines]
> Or give up on this approach and move the logic out of the database
> (dang)?
Today SQL UDF which include BEGIN ATOMIC are serialized.
In a DPF enviroment (which I presuem you're in) this means that got
yourself a bottlenck. It will also limit the optimization capabilities
of the optimizer
SQL UDF work great when you can reduce them to only RETURN:
create function IP2STRING(IP_BIGINT bigint)
returns varchar(15)
deterministic
no external action
contains sql
return RTRIM(CHAR(MOD(BIGINT(ip_bigint / 16777216), 256)))
|| '.' || RTRIM(CHAR(MOD(INTEGER(ip_bigint / 65536), 256)))
|| '.' || RTRIM(CHAR(MOD(INTEGER(ip_bigint / 256), 256)))
|| '.' || RTRIM(CHAR(MOD(ip_bigint, 256)))
Enjoy
Serge

Signature
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
kenfar - 24 Jan 2006 16:32 GMT
Serge,
> SQL UDF work great when you can reduce them to only RETURN:
Thanks! That worked perfect.
> Today SQL UDF which include BEGIN ATOMIC are serialized.
> In a DPF enviroment (which I presuem you're in) this means that got
> yourself a bottlenck. It will also limit the optimization capabilities
> of the optimizer
Any suggestions for reference material on this subject? Is Paul Yip's
book the best resource?
Ken Farmer
Serge Rielau - 24 Jan 2006 19:26 GMT
> Serge,
>
[quoted text clipped - 9 lines]
> Any suggestions for reference material on this subject? Is Paul Yip's
> book the best resource?
Not sure how much he has on this topic. Assuming your email address
works I just sent you and (aged) DBM Tech presentation.
If you want to get really into things you can read up the patents:
http://patft.uspto.gov/netahtml/search-bool.html
5,987,455 Intelligent compilation of procedural functions for query
processing systems
5,963,934 Intelligent compilation of scripting language for query
processing systems
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab