DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: optimize

Hybrid View

  1. #1
    Join Date
    Jun 2001
    Posts
    45
    How can one optimize %XYZ% queries?

  2. #2
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    If that's the only thing in your WHERE clause, force the index.

    - Chris

  3. #3
    Join Date
    Jun 2001
    Posts
    45

    optimization

    yes. how to force index? for the sql
    select * from table1 where col1 like %Prod%;

  4. #4
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    Well, I have no idea what the name of the index is, but supposing you had an index named index1 on table1.col1, then
    SELECT /*+ INDEX(T1,INDEX1) */ * FROM TABLE1 T1 WHERE COL1 LIKE '%PROD%'

    HTH,

    - Chris

    [Edited by chrisrlong on 07-27-2001 at 10:01 AM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width