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.
In reply to Re^3: database sorter script
by runrig
in thread database sorter script
by santander
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |