新手请教db2 创建主键非聚集索引

[复制链接]
查看11 | 回复9 | 2014-3-10 14:09:19 | 显示全部楼层 |阅读模式
CREATE TABLE tablename
(A CHAR(8)NOT NULL,
B CHAR(8)
CONSTRAINT PK_tablenamePRIMARY KEY (A))
想设置主键生成的索引为非聚集,请问在哪里添加条件?
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
i don't think PK is clustered by default if you don't specify it...
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
wangzhonnew ===如果一个表有好几个索引(包括PK的) 数据库会在那个索引上做cluster啊?还是根本就没 ?
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
if you define a cluster index, then it will do cluster at the one you defined...

or if it's MDC, it will cluster the data at the dimention you defined
otherwise if it's not MDC and there's no clustered index defined, it will not do any data cluster
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
多谢wangzhonnew
再请教一下,在网上看到了这个
In DB2 for z/OS,the first index defined is the clustering index unless another index is
explicitly defined as the clustering index.
这种说法对么?
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
i don't know about db2 for z

i don't think PK is default as clustered index in UDB, please correct me if i'm wrong


回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
Z和UDB还是不一样的
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
原帖由 wangzhonnew 于 2008-7-8 01:56 发表
if you define a cluster index, then it will do cluster at the one you defined...

or if it's MDC, it will cluster the data at the dimention you defined
otherwise if it's not MDC and there's no clustered index defined, it will not do any data cluster





回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
UDB里确实没有默认主键为聚集索引
我想确定一下Z/os里的情况,呵呵
多谢了
回复

使用道具 举报

千问 | 2014-3-10 14:09:19 | 显示全部楼层
unixnewbie, 呼唤你呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行