in reply to Re^2: database sorter script
in thread database sorter script
Like is evil. They do full table scans since a db can't do a function index against it.If there are any databases that can do function indexes against "like", I'd love to know.It depends on the database, and your query. If the query begins with a constant string (e.g. where column like 'ABC%') then the database can use an index on the column. If it begins with a wildcard (e.g. where column like '%ABC') then an index on the column can not be used. If your database determines the query plan at 'prepare' time, then it will probably not use an index on a query with placeholders such as 'where column like ?' since it doesn't know what kind of arguments you'll feed it at 'execute' time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: database sorter script
by exussum0 (Vicar) on Dec 06, 2004 at 18:20 UTC | |
by tachyon (Chancellor) on Dec 07, 2004 at 00:21 UTC |