Re: What's the performance impact of changing data type of primary key from INTEGER to CHAR(16)
Posted in 1996
There are several impacts to making this change. First your key will increase from 4 to 16 bytes. Over 2.5 million rows, thats 30,000,000 extra bytes for storage just for the rows. Then there's the indexes.... I am currently using a 10 byte character string as the primary key for a number of tables. I would like to make the move to using INTEGER, but there's no budget for those changes at the moment. It would depend on how it is implemented, but I suspect that you will lose the time between an equality check and a memcmp statement. It propbably won't kill you, but.... In any event, I am VERY interested in hearing what results you get. I can certainly use the results to drive a change in the other direction for my project. Thanks, Kevin -- mkmchu +------------------------------+-------------------------+----------------+ | Kevin McHugh - SW Engineer | mkmchu@fax.cs.mci.com | | MCI Telecommunications Corp. | (719) 535-5278 | +------------------------------+-------------------------+----------------+ | ALL RIGHTS RESERVED. | | This posting is copyright and may be used only for the purposes | | of professional study. Use of this posting in any commercial | | environment is explicity prohibited. This posting may only be | | reproduced for personal archival purposes. | +-------------------------------------------------------------------------+