• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Index not used on Tables in views

 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I my query a View is used. This View references 2 tables. However when i take tha eplan for this Query i notice that the Primary key indexes on both thse tables are not being used.
How can i get around this problem?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could not respond to this question because I need more info.
Is it on Oracle ?
Is it a inner join = or an outer join =(+)?
You speak of primary key but do you have foreign key ?
Are your indexes created correctly ?
...
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sajee,
I know that several DBMSs -- including Oracle and IBM DB2 (latest versions) -- contain "query optimizers". Depending on the way they are configured, they may rewrite the query you enter, in order to maximize its efficiency. Sometimes, it is more efficient for a query to do a "full table scan" than to use the index. Hence, it is quite reasonable to see a query plan that does not use indexes.
Some people say that if a query will return at least 15% of a table's entire rows, then it should not use the index.
Hope this has helped you.
Good Luck,
Avi.
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic