SQLite is slow?
#1

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!
Reply
#2

it's slow, use mysql
Reply
#3

Quote:
Originally Posted by FelipeAndres
View Post
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.
Reply
#4

Quote:
Originally Posted by Logic_
View Post
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.
To add to what @Logic_ said, no matter what database management system you're using, make sure all of your queries are optimized to increase performance, delete wasteful records and make use of the event schedule that some systems provide. Cashing can save you a lot of pain as well.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)