Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion wildcard search and full tablescans
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
hpuxrac  
View profile  
 More options Dec 7 2006, 8:52 am
Newsgroups: comp.databases.oracle.server
From: "hpuxrac" <johnbhur...@sbcglobal.net>
Date: 7 Dec 2006 05:52:53 -0800
Local: Thurs, Dec 7 2006 8:52 am
Subject: Re: wildcard search and full tablescans

wagen...@yahoo.com wrote:
> Oracle10g 10.2.0.1

> select * from <table_name> where <column_name> like '%abc%';

> does not use the index and does a full tablescan (guess this is the
> expected behaviour as per explain plan).

> Any suggestions as to how to use the index (index hint didn't help), IF
> possible or other alternatives.

> thanks

If you CANNOT begin the search with some leading characters ( not the
percent sign ) ... ie where some_col like 'abc%' ... then normally I
would expect to the optimizer to pick either a full table scan or some
kind of index scan.

You might want to do a 10053 trace and some analysis of where the
optimizer is going with your query.

You can put in a hint like this select /*+ INDEX(table_or_view_name
optional_index_name) */ column_list FROM etc ...

Eiher a full table scan or a full index scan ( of some type ) produces
an application that has scalability limitations built into it.  ( Your
logical IO's are very high ).

For full searching within a column there are options including the TEXT
indexes but they have some complications ( different SQL where syntax,
maintenance and cpu implications etc ).

Oracle will work nicely with regular character indexes IF you put a
where clause and a like that DOESN'T start with a percent sign.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.