when we c开发者_JS百科reate a foreign key in a table does it always become a duplicate index?
In DB2 for z/OS, if you create a table with a foreign key, you do not have to define an index on its underlying column.
An index will not be defined automatically when you create the table. If you want one, you can create one separately (via a CREATE INDEX
statement). I think it is common to define an index that includes the foreign key column(s), but it is not a requirement. It all depends on how your application accesses the data.
For an overview on DB2 keys, check this out: http://publib.boulder.ibm.com/infocenter/zos/basics/index.jsp?topic=/com.ibm.db2z.doc.intro/db2z_keys.html.
精彩评论