in reply to Re^3: database sorter script
in thread database sorter script

It depends on how the indexing works. Oracle is typically smart enough for it if you use the default index scheme. But mind you, as you brought up, it's not always portable to do what you suggest. Some db's aren't savy like that.

Update in italics.

----
Give me strength for today.. I will not talk it away..
Just for a moment.. It will burn through the clouds.. and shine down on me.

Replies are listed 'Best First'.
Re^5: database sorter script
by tachyon (Chancellor) on Dec 07, 2004 at 00:21 UTC

    LIKE is not inherently evil. It is a tool that has a place but does have the potential for abuse. This is the same for all tools. Nothing is fool proof, fools are simply too ingenious ;-) Anyway MySQL will also use an index for LIKE 'foo%' if there is an index available. It only table scans if you have an initial wildcard LIKE '%foo' or of course if there is no index.

    cheers

    tachyon