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

Thread: Plz Help

Threaded View

  1. #5
    Join Date
    Jan 2001
    Posts
    2,828
    Hi


    create table test
    as select object_id key1,object_name key2,object_id key3
    from all_objects


    create unique index testidx
    on test(key1,key2,key3)

    analyze table compute test compute statistics

    select distinct(key1),key2
    from test


    Execution Plan
    ----------------------------------------------------------
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=306 Card=23004 Bytes
    =667116)

    1 0 SORT (UNIQUE) (Cost=306 Card=23004 Bytes=667116)
    2 1 TABLE ACCESS (FULL) OF 'TEST' (Cost=44 Card=23004 Bytes=
    667116)


    well the most expensive operation here obviously is

    SORT (UNIQUE) investigate wheather you really need that distinc(key1)

    regards
    Hrishy
    Last edited by hrishy; 12-08-2003 at 07:28 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