Download A4 - Rush Flat Consulting
Transcript
Design Issues Page 158 The trigger would check the index of the file to find the item-id associated with the quarter, country, and HS code defined in the record. If the index value did not exist, then it would allow the write to the file; if the item-id was the same as the item currently being written, then it would allow the write (overwriting the existing item); if the item-id was different from the item currently being written, then it would disallow the write. 7.4 What is the “Best” ID for the Exports File? So far, we have really considered two ID structures for the exports file. The first uses three elements of meaningful data spliced together, while the second uses a sequential number. Those ID’s for equivalent items are shown below: 20123*CN*02 343198 The biggest problem with the first of these is that country codes change periodically. We don’t have that issue with the second item-id, but it requires some extra steps to allow lookups to related items; it requires that we index the file using the unique combination of elements; and we need to guard against creating multiple entries for nominally unique combinations of elements. Given that the major issue is with country codes, why don’t we simply replace these in the first structure with a numeric code? That would make the first item-id: 20123*156*02 This may not totally get us away from changes in country codes, but it is a good step in the right direction. With this structure, we can’t create multiple records for the same unique combination. Related item lookups are relatively easy. We don’t need to index the file (although indexing will still improve performance). What lessons can we take from this? ➢ You need to think carefully about your item-ids ➢ It is helpful to construct your make up a unique combination ID from multiple small elements which together ◦ This is better than using a single sequential number to embody all uniqueness ◦ Each element in the ID should not be subject to change Getting Started in OpenQM - Part 1 © Rush Flat Consulting