Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Index not used on Tables in views

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • 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?
 
Laurent Leonard
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • 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 ?
...
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic