> > The problem now is that get_lines is being called twice per line. > > Is get_lines() defined as IMMUTABLE? Should it be?
I have tried defining get_lines as "IMMUTABLE", or "WITH (iscachable)", but it keeps on getting called twice per line in the following query... select id, usr, code, (get_lines(code)).line1, (get_lines(code)).line2 from tbl; I wish there was a way to run the query like this: select id, usr, code, CAST(get_lines(code) as lines) from tbl; ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings