using big primary keys v/s small primary keys

using big primary keys v/s small primary keys

Post by Narasimha Murt » Wed, 05 Sep 2001 15:01:58



We are designing some tables. To continue with this i want following
information. pls somebody help me.
Does the length of the primary key in a table affect the performance
of the table during insert/update/delete operations.  Will a table
perform better with smaller key like of varchar(10) against
varchar(250) may be.

Thanks in advance for your help,
Murthy

 
 
 

using big primary keys v/s small primary keys

Post by Alphonsus Andrad » Thu, 06 Sep 2001 03:35:40


Quote:> Does the length of the primary key in a table affect the performance
> of the table during insert/update/delete operations.  Will a table
> perform better with smaller key like of varchar(10) against
> varchar(250) may be.

   Hi,
   as you might know, when you create a PK a unique index is created to
"support" the constraint, so the bigger the PK the bigger and *deeper*
the index will grow and this is not good for performance (talking about
real size). Also remember that any foreign key that  points to this PK
will also need the same amount of space. In my modest opinion I think
you should choose the smaller PK possible.

   Regards,
   Alphonsus.

--
Posted from inet1.spress.com.br [200.196.44.2]
via Mailgate.ORG Server - http://www.Mailgate.ORG