Good day comrades.
I would like to ask, maybe someone knows: is it acceptable to use decimal field(s) in keys (in primary also)? If acceptable, will it be performance-breaking or normal?
Thanks in advance for constructive answers.
It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
0
Comments
Well... as soon as I finish current task, I'll make some investigation in this topic and post here
But, still expect for more activity!
Did anyone see/use such stuff? Was it good in performance with millions of records?
actually, nav standard uses decimal fields in some keys (also in pk): i don't think it's a good practice, but as rhpnt said, sometimes is just needed!
i would care about the correct fillfactor to use, bacause a decimal field can be inserted almost anywhere in the index, thus i would select a low fillfactor (don't ask me how much), especially if the decimal field is one of the first fields in the key.
As a rule of thumb, if you go for it (and if it's possible for your businnes logic) you should put that decimal field as one of the last fields in the key.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Customer wanted primary key like this: I told him that he will get performance down, proposed and implemented solution with the following key: This field has automatic increment, it is unique and unchangeable for user.
Other fields, proposed by customer, are implemented, but are not in key.
now I start creating simple table with customer supposed key, fill it with millions of random data and test access performance.
with only one code20 in key i get ~15 seconds...
so, performance is real
(i supposed sql)15 secs for 500000 records seems too much for me...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
what field are you searching?one of the fields in the key or something else?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I believe that the table you are trying to put that weird key in is a "combination" table combining the metal group with different thicknesses which has to be unique!?
The solution without using the "unusual" key would be that you check the unique thickness by code. This is very simple, just put the checking routine in the onInsert and onModify trigger of the given table and voila you've created a check constraint.
2rhpnt: I did something like that