- Log in to post comments
User bio
404 bio not found
Member since Jun 29, 2017
Posts:
Aviel has not published any posts yet.
Replies:
Certifications & Credly badges:
Aviel has no Certifications & Credly badges yet.
Followers:
Following:
Aviel has not followed anybody yet.
In short, the primary key is the value the application uses to identify a row in the table (for example in joins). The %ID (IDKEY) is the value the systems uses internally (the "row address") to identify a row in the table.
Thus the system always maintains an index on the primary key, so the application can use it, in addition to the "master map", which is an index on %ID.
Often the primary key is a value generated by the application, while the %ID is a system-generated integer.
Obviously the duality of having 2 different ways and indexes to identify rows might not necessarily be a good thing, and you can overcome that in 2 ways:
Note that solution 1 above could be a problem, esp. if the primary key consists of more than one field or is not an integer, since the system-generated %ID lends itself better to more efficient processing, including usage of bitmaps.
So, depending on the nature of the application, sometimes it's better to have separate indexes for the application-generated primary key and the system-generated %ID.