andyyou
02-18-2003, 07:16 AM
have to do an essay on numeric v non numeric keys and also mantaining v generating calculated fields have no information and can't find anything anyone help :confused: :confused: all suggestions will be gratefully recieved ty hopefully
I will throw some issues out. If a key is truly numeric (stored in binary format) than there is no conversion needed to compare to another value if it is binary. Strings are stored as numerics and have to be compared character by character. Also storing a binary number takes less space than strings, but that is more because of the nature of each. (Depends on system) Integer is a byte, and can store from 0-255, but the same byte can only hold one character. There is more processing required to process (search/compare) a string. Plus strings are usually larger than a number and that requires more processing. That is pretty basic, but should give you an idea.
Store or Calculate "on the fly" values. Depends on the processing overhead required. It requires space to hold a calculated value, it takes processing power to calculate it. If you have to read a million rows to create a number 20 times a day, it may be better to store that number, however if that number changes by the nature of the interactive data, it is better to calculate it each time. We general find it better to recalc each time for 99.9% of these values rather than maintain a value can change. As an example, what of the tax laws change between say a Quote and the final sale? Now you have charge an extra 1.5%, how do you update everything in the works already, or do you "bite the bullet" and pay the 1.5% out of your pocket?