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

Thread: most efficient query

  1. #1
    Join Date
    Apr 2001
    Posts
    46

    most efficient query

    How to rewrite this request the most efiiciently

    select table_name, owner ,index_name
    from dba_indexes
    where table_name not like '%_TOI%'
    and table_name not like '%_WRK%'
    and table_name not like '%_JOB%'
    and table_name not like '%_WK%'
    and table_name not loke '%_TRA%'
    and table_name not like '%_GOR%'
    yt

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Negative logic causes multiple result sets and merges.
    It would work faster if you knew what the table_name was like.

    select table_name, owner ,index_name
    from dba_indexes
    where table_name like '%_SOT%'

    You could also store the vaules in another table and add a field to act as a flag that you can query by.

    select table_name, owner ,index_name
    from my_dba_indexes
    where is_eom_index_name = 'Y'

  3. #3
    Join Date
    Apr 2001
    Posts
    46
    thanx for your reply

    so if I understand, with negative logic 'not like clause' we can nothing do to make the request faster.
    I don't know what my table_name look like, but only what they
    don't look like, that's why i can only use negative logic.

    I will try your second solution.
    yt

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