Re: Problems with query not using expeced indexes
Posted by:
Rick James
Date: March 18, 2010 07:41AM
A column can be in multiple indexes.
About the only constraint is that there can be only one PRIMARY KEY.
Here is a wasteful (but not invalid) situation:
INDEX(a),
INDEX(a)
one is redundant.
UNIQUE(a),
INDEX(a)
remove the INDEX; UNIQUE is an index with an extra constraint (no dups of `a`).
INDEX(a,b)
INDEX(a)
Usually the second one is unnecessary; the first one can be used whenever the second one is desired.
INDEX(a,b)
INDEX(b,a)
These are significantly different; sometimes it is advisable to have both.
Subject
Views
Written By
Posted
4426
March 09, 2010 07:12AM
1643
March 09, 2010 07:13AM
1830
March 10, 2010 10:28PM
1660
March 11, 2010 06:08AM
1659
March 11, 2010 11:00PM
1722
March 17, 2010 12:16PM
1814
March 17, 2010 09:57PM
1536
March 18, 2010 01:06AM
Re: Problems with query not using expeced indexes
1914
March 18, 2010 07:41AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.