开发者

Foreign keys in tables

开发者 https://www.devze.com 2023-01-28 13:27 出处:网络
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 underl

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消