Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

substr versus like - which is least costly

RackoWackoOct 24 2008 — edited Oct 29 2008
I'm looking to learn some basic principals.
What is the basis for determining which is least costly between SUBSTR and NOT LIKE

My SQL at hand is too simple, and my table too small, to see a difference only by runtime or explain plan.

select code_code, description
from codes
where type_code = 'GEO'
and stop_date is null
--and substr(description,1,8) != 'UNINCORP'
and description NOT LIKE 'UNINCORP%'

Edited by: RackoWacko on Oct 24, 2008 4:00 PM

Edited by: RackoWacko on Oct 24, 2008 4:01 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2008
Added on Oct 24 2008
8 comments
892 views