MySQL vs SQLite
#13

Quote:
Originally Posted by Calgon
View Post
Actually, I think SQLite is faster in SA-MP than the MySQL plugin is for executing queries.
I ran some benchmarks a couple months ago in a previous thread, but there's always the possibility im missing something that makes the test invalid or unfair. Here's the quote from the previous thread. I do encourage other people to run their own bookmarks, possibly with more statements (i only used the 3 most common).

I really only learned enough SQL to get by, so my knowledge of optimizations/engines isnt as good as it SHOULD be. There may even be ways to speed up MySQL as well, im not entirely sure. Either way though, with the option to thread queries (i didnt do so in these tests) i think MySQL is the best choice.

Quote:
Originally Posted by Kyosaur
Code:
[20:54:29] SQLite test starting...
[20:54:42] SQLite Insert: 100 queries in 12684 ms
[20:54:42] SQLite Select: 100 queries in 25 ms
[20:54:42]  >> SQLite Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST
[20:54:56] SQLite Update: 100 queries in 13692 ms

[20:54:56] MySQL test starting....
[20:54:56] MySQL Insert: 100 queries in 35 ms
[20:54:56] MySQL Select: 100 queries in 39 ms
[20:54:56]  >> MySQL Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST
[20:54:56] MySQL Update: 100 queries in 133 ms
Here is the script i threw together for this test. Keep in mind the goal was to try and make this a fair fight, so thats why there is some weird stuff in there (more so on the mysql side).

http://pastebin.com/BCn3KdSc


Edit: By adding this line SQLite was speed up dramatically (Credits to cessil for the line):

Code:
db_query(g_Sqlite, "PRAGMA synchronous = OFF" );
Here are the new results (MySQL is still not threaded in this example):

Code:
//test 1
[07:15:29] SQLite test starting...
[07:15:30] SQLite Insert: 100 queries in 519 ms
[07:15:30] SQLite Select: 100 queries in 12 ms
[07:15:30]  >> SQLite Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST
[07:15:30] SQLite Update: 100 queries in 342 ms
[07:15:30] MySQL test starting....
[07:15:30] MySQL Insert: 100 queries in 23 ms
[07:15:30] MySQL Select: 100 queries in 34 ms
[07:15:30]  >> MySQL Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST
[07:15:31] MySQL Insert: 100 queries in 120 ms

//test 2
[07:15:50] SQLite test starting...
[07:15:50] SQLite Insert: 100 queries in 439 ms
[07:15:50] SQLite Select: 100 queries in 11 ms
[07:15:50]  >> SQLite Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST
[07:15:50] SQLite Update: 100 queries in 343 ms
[07:15:50] MySQL test starting....
[07:15:50] MySQL Insert: 100 queries in 24 ms
[07:15:51] MySQL Select: 100 queries in 34 ms
[07:15:51]  >> MySQL Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST
[07:15:51] MySQL Insert: 100 queries in 119 ms
Reply


Messages In This Thread
MySQL vs SQLite - by Steve M. - 21.12.2011, 14:05
Re: MySQL vs SQLite - by T0pAz - 21.12.2011, 14:06
Re: MySQL vs SQLite - by wups - 21.12.2011, 15:20
Re: MySQL vs SQLite - by wups - 21.12.2011, 15:45
Re: MySQL vs SQLite - by DonWade - 21.12.2011, 16:08
Re: MySQL vs SQLite - by Steve M. - 21.12.2011, 18:28
Re: MySQL vs SQLite - by JoxyBullet - 21.12.2011, 21:12
Re: MySQL vs SQLite - by [HiC]TheKiller - 21.12.2011, 22:38
Re: MySQL vs SQLite - by Calgon - 21.12.2011, 22:41
Re: MySQL vs SQLite - by linuxthefish - 21.12.2011, 23:17
Re: MySQL vs SQLite - by Kyosaur - 21.12.2011, 23:18
Re: MySQL vs SQLite - by Calgon - 21.12.2011, 23:48
Re: MySQL vs SQLite - by Kyosaur - 22.12.2011, 01:12
Re: MySQL vs SQLite - by Calgon - 22.12.2011, 01:40
Re: MySQL vs SQLite - by Ryan_Obeles - 30.03.2013, 04:55
Re: MySQL vs SQLite - by CoaPsyFactor - 30.03.2013, 05:45
Re: MySQL vs SQLite - by CoaPsyFactor - 30.03.2013, 15:29
Re: MySQL vs SQLite - by Pawnie - 30.03.2013, 15:31
Re: MySQL vs SQLite - by CoaPsyFactor - 30.03.2013, 15:33
Re: MySQL vs SQLite - by Finn - 01.04.2013, 10:11

Forum Jump:


Users browsing this thread: 1 Guest(s)