Reply to thread

I knew there was one more thing I wanted to try :D

I read somewhere that using a BLOB as primary key is a very bad idea. MP2 uses Guids as primary keys and I told SQLite to store Guids as BLOBs. New idea therefore, let's store Guids as text (unfortunately Guids are 128 Bit. I also read that you could get a real speed improvement by using INT (64 bit) as primary key, because SQlite creates its own (hidden) RowNumber cloumn for every table unless you use an INT as primary key. In the latter case, the primary key is at the same time used as RowNumber, which saves time. But this is not possible, because we don't get our 128 bit Guid into a 64 bit INT...)


So here the results for Guids stored as string:

locking_mode=Exclusive / Shared Cache / Page Size 4KB / Discarded the respective first result /  Store Guids as text (instead of binary)

ImportTest: 20:53 min

ReadTest 1: 12770ms, 12732ms (25502ms)

ReadTest 2: 234ms, 237ms (471ms)

ReadTest 3: 12.7ms, 10.4ms (23.1ms)

ReadTest 4: 51.9ms, 32.9ms (84.8ms)


Result is: writes are slower (expected, because the database file is now a bit bigger and therefore more data to write). ReadTests 2 and 4 are a bit slower, ReadTest 3 is materially slower. So back to storing Guids as binaries (and don't always believe what you read in the internet :D )


Top Bottom