[Freebase-discuss] Converting Freebase mid to integer
paul at ontology2.com
Tue Sep 27 14:12:28 UTC 2011
It's not crazy to be concerned about the efficiency of database
keys. On the other hand, properly used mids are fairly efficient.
Those who use sequential integer primary keys are almost always
satisfied with performance; some of them have tried a different kind of
key and found performance degraded by orders of magnitude.
The first explanation that comes to many people for this is the
small size of the integer key, which uses less RAM, less disk space,
less room in the cache, fewer disk blocks, etc. This is a real
effect, but it's nowhere near large enough to account for the huge
performance change. This guy did a nice experiment
who showed that sequential integer keys are drastically faster in
Microsoft's SQL server than GUIDs, not because of the the size, but
because they're sequential. Once he started generating sequential
"GUID" objects (breaking the GUID property of the objects) he found only
a tiny difference compared with primary keys.
More information about the Freebase-discuss