Posts: 10
Threads: 6
Joined: Dec 2016
Reputation:
0
Hi,
I have a server with 80-85 daily users and 42k registered accounts, but when loading a list, for example, a TOP, the server lags too much
The database size is 70 MB
I need help, thanks!
Posts: 1,506
Threads: 13
Joined: Jun 2015
Quote:
Originally Posted by FelipeAndres
it's slow, use mysql
|
MySQL is faster than SQLite but that all also depends on your database and how you manage it.
I run a query every month that deletes accounts inactive for 2 months and remove accounts of hackers and just keep the ban records because I ban their IP and account-name.
In some tasks such as the top list etc, I cache them every hour from the database and have a command to force update it where necessary.
Posts: 1,228
Threads: 1
Joined: May 2018
Reputation:
0
SA-MP uses SQLite version 3.7.0.1 which was released in 2010-08-04. It is 98 releases behind the latest version. There are many compile-time options that would help speed it up if the library was compiled with.
You need to create index at the column you order by with. If using it correctly (optimized database), it can select a column from 2.5 million rows in 1 millisecond.
You mentioned the file size is 70MB. How many tables, columns per table, rows and indexes does it have? Indexes speedup select queries, increase file size and slow down insert/update/delete queries. The more data, the slower writing to database will be.
If you ever consider to switch to MySQL, do not even hesitate to do it. Importing the data from SQLite should not be difficult.