You are not logged in.
Hello friends!
No matter the performance costs, I would like to adapt the TID class to GUID ...
Has anyone here ever done? Is there any prediction to be made?
Thanks!
(BY GOOGLE TRANSLATION)
Offline
I think it will not work cause the TID as int64 is essential for mORMot and massivly used internally
Rad Studio 12.1 Santorini
Offline
Agree with @idSDS
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
We defined the TID to follow the SQlite3 integer primary key, which is a Int64.
It is from the ground up to SQLite3 and to mORMot.
Using random GUID is IMHO a bad practice, especially in term of performance: integer sequences will put the inserted data in order in the disk, which is exactly what you expect most of the time.
With SQlite3, you could use a GUID blob field with an index, and good performance.... but behind the scene it will still do a lookup from a Int64 ID, so it will always be slower, and consume disk space for no benefit.
If you want to have genuine generated TID values across several ends, see our TSynUniqueIdentifier which was meant exactly for this purpose - still using Int64.
Online
Ok, I really need this. We will fork to meet our demand. We use Oracle and we always will, so this fork makes a lot of sense to us. Thank you all! Strong hug.
Offline
Just for information: some years ago we do a refactoring of a huge system (MS SQL ~100millions of rows in some tables) where GUID`s are used as a primary keys. After migrating to Int64 database operations become MUCH faster (index over int64 use less space compared to GUID so more data can be in memory cache, tables use less space so more data can fit in memory etc.) And this is MS SQL where GUID support is very good. I think for Oracle GUID is a big problem. For big databases, of course
Offline
Friends are very right. I was seduced by the fact that I could exchange information between repositories without the worry of ID collision. ID Int64 can be safely used as long as there is a plan to do so.
Offline