P&T Guide Question [Restructuring SQL Statements] [message #458259] |
Fri, 28 May 2010 04:51 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
P&T guide p226
Hi, I'm reviewing the P&T guide [10g Release 2 (10.2) B14211-03], specifically the section under Restructuring SQL Statements.
I'm 100% clear on not using functions on indexed columns, makes perfect sense, however I'm confused by the detail in the upper half of p226 of the guide:
Quote:When you need to use SQL functions on filters or join predicates, do not use them on
the columns on which you want to have an index; rather, use them on the opposite
side of the predicate, as in the following statement:
TO_CHAR(numcol) = varcol
rather than
varcol = TO_CHAR(numcol)
I'd always thought that the order of the predicate comparision made no difference, i.e. 'x=y' would be processed identically to 'y=x'. It might be my understanding but the quoted section makes sense and fits with my expectation up until then example given. I cant see any reason either of those statements would be handled differently by Oracle - assuming they are run on identical tables of course.
I'd be grateful if anyone could explain what they mean by this.
Thanks
|
|
|
|
|