Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Re: Re: Re: Re: Re: Re: dbi style questions (code, discussion)

by edebill (Scribe)
on Jan 02, 2002 at 00:45 UTC ( [id://135549] : note . print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Re: Re: Re: dbi style questions (code, discussion)
in thread dbi style questions (code, discussion)

It actually has to parse it in that case to compare the placeholders :-) The real win is when it can avoid passing it to the optimizer, because it already has an execution plan worked out.

Our queries are simple enough that we actually turn down the SQL optimizer (for instance, we went for a long time with only 1 query that did a sub-select. Then I rewrote the query so it only needed a simple comparison.) This is actually recommended by IBM - they have docs on what optimization level to use for different things, and we fall squarely in the "turn it off, it's just wasting cycles" category.

Part of the reason that DB interfaces (and databases themselves) are so hairy is that there are so many different usage cases, and they try to let you optimize for all of them. It's like having a Linux distro that tries to work well for everything from embedded devices (e.g. iPaq) to monster servers (e.g. Sun E10k).