Well, it seems that
select ... from my_proc(my_params, ...)
join my_table on ...
can be much slower than putting the code into a separate stored procedure and simply selecting * from it. Optimizer confused?
Oh well, I have to investigate some more, but some of my selects now run 6x faster… which is a good thing (TM) 😉
Also, requesting plan on some complex queries (with a large plan) seems to crash ibserver. Doh… plan buffers limited in size to a hardcoded value? Found some hints on the newsgroups, turning off plan request on the client solves it, still it’s hard to believe.