Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear colleagues.
I want to ask you how best to create a composite key, to save resources.
AutoNumberHash128 () or by connecting strings [fileld_1] & ' ' & [fileld_2]
AutoNumber is always better because when we create an composite Key as [fileld_1] & ' ' & [fileld_2] , then for each and every unique Key it will assign a memory and pointer an will consider as an String.
and when we use Autonumber it will consider is as number.
And Number consume less space then string.
Regards,
Vanraj Dinesh Bohra
Certain better option is: AutoNumberHash128 ()
Hi Anton,
I would go for autonumber e.g.
Autonumber([fileld_1] & '|' & [fileld_2],'AutoID1_2') as AutoID1_2
Using the '|' as a separator is a good practice unless that symbol is used in any of the fields you are making the composite key out of. The parameter 'AutoID1_2' is just to keep separate this autonumber sequence from any others you might be creating in your script
Cheers
Andrew
Thank you.
I have an old application in legacy. And there are lot of this kind keys (&' '&). This Application has three or four hours update time.
I think if I change them, I lower the update time and physical size of application.
Yes, with other possible improvement areas, if you try autonumbering, you should see an improvement in file size. However, I would also suggest to be careful of other nuisances of the same like 'load order dependency' (if using without hash.. read here: AutoNumber() vs Auto..Hash() )
AutoNumber is always better because when we create an composite Key as [fileld_1] & ' ' & [fileld_2] , then for each and every unique Key it will assign a memory and pointer an will consider as an String.
and when we use Autonumber it will consider is as number.
And Number consume less space then string.
Regards,
Vanraj Dinesh Bohra
Thank you colleagues.
I realized that the potential for optimization I have with my legacy is great. Starting with the keys and ending with redundant data. I will continue to work.
Thanks for the link. Very interesting.