Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    8

    Unanswered: Suppressing indexes

    If the primary key of a table is a string and I do a search on that column using a LIKE clause, is the index suppressed?

    EX:

    SELECT * FROM table1 WHERE col1 LIKE 'test%';

    (there's an index on col1 - the PK)

    Does is use the index or not?

    Thanks,
    - Dylan

  2. #2
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273
    Yes, It will use the index in this case. But in the followin case, the index will not be used.

    PHP Code:
    SELECT FROM table1 WHERE col1 LIKE '%test';
    or 

    SELECT FROM table1 WHERE col1 LIKE '%test%'
    HTH
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

Posting Permissions

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