|
Archives of the TeradataForumMessage Posted: Thu, 05 Dec 2003 @ 01:08:31 GMT
Forget about PRIMARY KEY - it is logical and it has absolutely nothing to do with an access path or the optimizer. If you have a multi-column primary index, the optimizer will only use it when you join to another table with ALL parts of the index. So you have this on Table1 UNIQUE PRIMARY INDEX (id1, id2, id3 ..., id13, id14, id15) and this on Table2 UNIQUE PRIMARY INDEX (id1, id2, id3) RESULT: The optimizer won't use the Primary index. The indexes have to be matching. An Explain will give you a better idea. One of the reasons a system generated key and thus index (unintelligent key) is popular is because of the above situation. This is besides the fact the a system generated key can (most like will) save you space. 100 million rows and an index with 15 columns.. hope you have a lot of spool space.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||