SQLite Table & It's Performance
#1

I have created a thread recently asking what should I use (YINI, SQLite or MySQL).
I decided to use SQLite and now I am done moving the script from INI to SQLite.

Now the thing that concerns me is that I have 13 tables (Houses, Users, Inventories ++) - Wouldn't that affect the server's performance or the way how SQL saves & loads the data? I have asked this question @ Konstantinos' SQLite Tutorial - He told me this: " 'Database Normalization' should be used where possible so it is still better to have many tables than one huge for all the data."

I don't know what it means but hopefully I am using SQLite properly, I am just concerned for my server in the future.

How would I know if i am using SQLite in a wrong way or something like it would cause some troubles in the server performance, leaks & all?

Help would be appreciated.
Reply
#2

****** about SQLite or even SQL and you'll find lot of help.

And more tables actually increase the speed instead of looking through a pile of data in just one table or afew tables. Data organization is a must in SQL.
Reply
#3

So it is not a problem for the data if I have more tables? As long as I am using SQLite properly it won't affect the server performance or anything?
Reply
#4

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
So it is not a problem for the data if I have more tables? As long as I am using SQLite properly it won't affect the server performance or anything?
No it's even better.
Reply
#5

So the more the tables I had, the faster the datas being saved / loaded by the SQL?

Thank you for letting me know about that both of ya
Reply
#6

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
So the more the tables I had, the faster the datas being saved / loaded by the SQL?

Thank you for letting me know about that both of ya
Its not a right statement of yours. I meant to say that data organization is what will help you gain speed. Lets take an example of a house script, there is 3 main parts of it: House Info, Furniture and Keys.

Slower:
Код:
TABLE: `Houses` with 100 columns
Faster
Код:
TABLES:
`Houses` ("ID" is PRIMARY KEY)
`Furniture` ("ID" will be FOREIGN KEY)
`Keys` ("ID" will be FOREIGN KEY)
Reply
#7

MySQL's faster, just a tip
Reply
#8

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
MySQL's faster, just a tip
Well that's not true. MySQL is having better features than SQLite in case of SA:MP since SQLite has not been updated since it was introduced to SA:MP or is not upto the latest release.

So yea, MySQL is beneficial if you really want to use those features otherwise SQLite can easily do the job for you. Plus i love the syntax of SQLite more than that of MySQL.
Reply
#9

I don't wanna create a thread anymore since I kept creating a thread about SQLite the past few days so I am gonna post it right here.

I am re-coding my Vehicle System and I am gonna use the #define MAX_VEHICLES, Wouldn't that affect SQLite when I used it on my enum / arrays?
Reply
#10

It depends on your database design. I don't see how MAX_VEHICLES could be a problem - I'd create a table and apply relational database concepts to make it even better. MAX_VEHICLES wouldn't be a problem as it must be affecting the number of rows only, not the number of tables or else you're doing it wrong. There's always methods to improve a database structure and forming a good DB structure would be the hardest part (according to my concern).

Foreign keys are supportable on SQLite too, so I'm linking you this tutorial which explains about foreign keys for MySQL. I've been more into MySQL than SQLite but I believe it's almost the same for both. Since you've mentioned that you're working on a vehicle system, it might be necessary to have database CRON jobs running in case if you have auto database update (whether resetting a vehicle or changing any values, or whatsoever to be done on your database), I'm also linking the event scheduler tutorial.

Table structure and foreign keys
Event Scheduler
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)