SA-MP Forums Archive
SQLite - Time queries - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SQLite - Time queries (/showthread.php?tid=227609)



SQLite - Time queries - OFFREAL - 17.02.2011

Hello, I have a question:
I use the SQLite database (standart a_sampdb.inc):
Time queries such as "SELECT" no more than 2 ms (for the complex - about 5 ms), but the queries such as "UPDATE" - about 150 ms, and I think that 150 is too much!
Please tell me this is normal or not?
- - - - -
What is the maximum length of a query using db_query?


Re: SQLite - Time queries - JernejL - 19.02.2011

Optimize your update queries and table design then.

also, this doesn't belong in this forum sections.


Re: SQLite - Time queries - nemesis- - 19.02.2011

Quote:
Originally Posted by JernejL
Посмотреть сообщение
Optimize your update queries and table design then.

also, this doesn't belong in this forum sections.
You can make a fair amount of assumptions here:
1) He doesn't sound like a very experienced coder so his tables are likely very simplistic with few columns.
2) His queries will be simple so there is little to nothing to optimize
3) 150ms for a query that writes is a significant amount of time
4) His tables likely have little data so indexing isn't going to make that huge of a difference

With these assumptions in mind, I'd say that he is having disk i/o issues on an update which takes 150ms. I have fairly complex/indexed queries (multi-joins, sub-selects, etc) which only take 5-7ms and similarly with updates.


Re: SQLite - Time queries - OFFREAL - 21.02.2011

How I can optimize my UPDATE queries?