CREATE TABLE [MYTABLE](
[ROW1] [numeric](18, 0) NOT NULL,
[ROW2] [numeric](18, 0) NOT NULL,
[ROW3] [numeric](18, 0) NOT NULL,
[ROW4] [numeric](18, 0) NULL,
CONSTRAINT [MYTABLE_PK] PRIMARY KEY CLUSTERED ([ROW1] ASC, [ROW2] ASC, [ROW3] ASC)
)
Run Code Online (Sandbox Code Playgroud)
该表有2个非聚集索引,以及以下统计信息:
RowCount: 5260744
Data Space: 229.609 MB
Index Space: 432.125 MB
Run Code Online (Sandbox Code Playgroud)
我想减小索引的大小,并使用代理主键作为聚簇索引,而不是自然复合键.
CREATE TABLE [dbo].[TEST_RUN_INFO](
[ROW1] [numeric](18, 0) NOT NULL,
[ROW2] [numeric](18, 0) NOT NULL,
[ROW3] [numeric](18, 0) NOT NULL,
[ROW4] [numeric](18, 0) NULL,
[ID] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [MYTABLE_PK] PRIMARY KEY CLUSTERED …Run Code Online (Sandbox Code Playgroud)