troubleshooting Question

Index utilization question when using wild card searches

Avatar of howemr
howemrFlag for United States of America asked on
Oracle Database
7 Comments3 Solutions400 ViewsLast Modified:
I'm not a database guy in general, and far more comfortable in MS SQL than apologies in advance.

I have a fairly large table (say 2.5 million rows) with individual indexes on several columns -- A, B, and C.

If I initiate a query with conditions on both indexed and non-indexed fields -- with a wildcard on the non-indexed field(s) -- similar to this:

...WHERE A = "value1" and B = "value2" and K = "%partialvalue%" AND L = "%partialvalue%"...

Will the index on column A and/or B be used at all?  I've been told that it will NOT, but this seems illogical to me.  I would guess the optimizer is smart enough to "handle" this by breaking the request into parts (or something) -- but my understanding of optimizers is about nil.

David VanZandt
Senior Database Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros