Data retrieval from disk

User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Data retrieval from disk

Post by mark »

You don't happen to have any particularly long values for DOCID do you? Check with
"select max(length(DOCID)) from tbldoc"
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Data retrieval from disk

Post by skalyanaraman »

Hi,
Here is the result,

max(length(DOCID))
------------+
11

11 chars is the biggest length.
User avatar
John
Site Admin
Posts: 2624
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

Data retrieval from disk

Post by John »

If the max length of DOCID is 11 you should declare it as varchar(12), or closer to the real max length than 50, otherwise you will be using a lot of space in the compound index that is not needed. The compound index is one of the rare places that the declared size of the field is actually used, as part of the metamorph index relies on fixed sizes for efficiency. That is also why you get the variable size warning when creating it.
John Turnbull
Thunderstone Software