>Local loGUID >loGUID = Createobject('GUIDLib') > >lcPKey = loGUID.GetGUID16() > >Define Class GUIDLib As Relation > Procedure Init > Declare Integer UuidCreate In 'RPCRT4.dll' String @pguid > Declare Integer CoCreateGuid In 'Ole32.dll' ; > string @pguid > Declare Integer StringFromGUID2 In 'Ole32.dll' ; > string rguid, String @lpsz, Integer cchMax > Declare RtlMoveMemory In WIN32API ; > INTEGER @DestNumeric, ; > STRING @pVoidSource, ; > INTEGER nLength >Endproc > > Procedure GUID16ToStr > lparameters tcGUID16 > Local rguid > rguid=Replicate(Chr(0),80) > StringFromGUID2(tcGUID16,@rguid,40) > Return Strconv(Left(rGUID,76),6) >endproc > > Procedure GetGUID16 > Local pguid > pguid=Replicate(Chr(0),16) > UuidCreate(@pguid) > Return pGUID >endproc > > Procedure GetGUID > Local pguid,rguid,lcFail > lcFail = "" > pguid=Replicate(Chr(0),16) > rguid=Replicate(Chr(0),80) > > If Inlist(UuidCreate(@pguid),0,1824) && 1824 = LOCAL_ONLY > Return Iif(StringFromGUID2(pguid,@rguid,40) # 0, ; > Strconv(Left(rguid,76),6), lcFail) > Endif > Return lcFail >Endproc >Enddefine >>Cetin
>>Index size GUID : 6.786.548 bytes >>Index size SYS(2015)+WsId : 863.744 bytes >> >>7.85 times more for GUID index >> >>After a REINDEX command >>Index size GUID : 4.767.744 bytes >>Index size SYS(2015)+WsId : 850.432 bytes >> >>5.60 times more for GUID indexes >> >>Average seek times , 100000 iterations, random keys >>Index on GUID : 1.880 seconds >>The othe index : 0.954 seconds >>>>