database - Oracle primary key affecting indexes -


i had index working nicely last night, low i/o stuff. morning added primary key table , performance has dropped , optimizer ignores index hints.. advice? thankyou

schema structure..

      product       id       pk       name            price           order_line       order_id    fk       product_id  fk       qty        orders       id             pk       o_date date       custid   

query...

      select sum(ol.qty)  product p,orders o, order_line ol                p.name = 'apricot jam'       ,       p.id = ol.product_id       ,       o.o_date = '03-mar-2014'       ,       ol.order_id= o.id       ; 

the index isn't using composite index on product (name,id), instead using products primary key index range scan thanks!

product table id pk name index01 price

i structure table way. query going range scan because going scan table p.name = 'apricot jam' clause in query.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -