PRB: Building Clustered Index on Empty Table Does Not MoveID: Q96018
|
One technique of moving an object onto a new segment within a database is to create a clustered index on the object. Creation of a clustered index will force a rebuild of the table, thus moving the table to whatever segment the clustered index was specified to be built on. However, creating a clustered index on a table containing no data will not result in the underlying table being rebuilt.
Consider the following scenario:
CREATE DATABASE TEST_DB ON TESTDEV1 = 2, TESTDEV2 = 2,
TESTDEV3 = 2
go
USE TEST_DB
go
SP_ADDSEGMENT TEST_SEG1, TESTDEV2
go
SP_ADDSEGMENT TEST_SEG2, TESTDEV3
go
CREATE TABLE TEST_TABLE ( COL1 INT NOT NULL ) ON TEST_SEG1
go
CREATE CLUSTERED INDEX CINDEX ON TEST_TABLE( COL1 ) ON
TEST_SEG2
go
Extent not within segment: Object <object ID of TEST_TABLE>, indid 1 includes extents on allocation page <allocation page in TEST_SEG1> which is not in segment <segment number of TEST_SEG2>.
Additional query words: segments
Keywords : kbprg SSrvServer
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 16, 1999