![]() As with all rules, there are specific situations where one may deviate from them. ![]() Primary Key Design TipsHere are some tips for creating primary keys. For instance, a customer table may have a secondary index on Zip Code to allow quicker searches on zip code values. Secondary indexes can be one or more fields that are defined to speed up searches by maintaining a pre-sorted list. The primary key is also important for secondary indexes. This makes it easy to link this table to data in other tables. ![]() ![]() Records in a relational database can be sorted and physically stored in any order, but the key field (or fields) define uniqueness for that record. Unfortunately, this makes it easy to create primary keys that are not optimal which can cause performance problems and even worse, architectural problems that become expensive to fix later.īackgroundEvery table in a relational database should be keyed. Microsoft Access Tables: Primary Key Tips and Techniques by Luke Chung, FMS PresidentMost databases, whether it's Microsoft Access, SQL Server, Oracle, etc., let you create tables and specify any field or fields as the primary key.
0 Comments
Leave a Reply. |