home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
SQLiteDatabase Plugin for MP2
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MJGraf" data-source="post: 1036234" data-attributes="member: 17886"><p>I knew there was one more thing I wanted to try <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /></p><p>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...)</p><p></p><p>So here the results for Guids stored as string:</p><p><strong>locking_mode=Exclusive / Shared Cache / Page Size 4KB / Discarded the respective first result / Store Guids as text (instead of binary)</strong></p><p>ImportTest: <strong>20:53 min</strong></p><p>ReadTest 1: 12770ms, 12732ms (<strong>25502ms</strong>)</p><p>ReadTest 2: 234ms, 237ms (<strong>471ms</strong>)</p><p>ReadTest 3: 12.7ms, 10.4ms (<strong>23.1ms</strong>)</p><p>ReadTest 4: 51.9ms, 32.9ms (<strong>84.8ms</strong>)</p><p></p><p>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 <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /> )</p></blockquote><p></p>
[QUOTE="MJGraf, post: 1036234, member: 17886"] 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: [B]locking_mode=Exclusive / Shared Cache / Page Size 4KB / Discarded the respective first result / Store Guids as text (instead of binary)[/B] ImportTest: [B]20:53 min[/B] ReadTest 1: 12770ms, 12732ms ([B]25502ms[/B]) ReadTest 2: 234ms, 237ms ([B]471ms[/B]) ReadTest 3: 12.7ms, 10.4ms ([B]23.1ms[/B]) ReadTest 4: 51.9ms, 32.9ms ([B]84.8ms[/B]) 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 ) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
SQLiteDatabase Plugin for MP2
Contact us
RSS
Top
Bottom