28.11.2010, 10:46
Okay well it's quite simple once you understand it, and it's not hard to explain so here we go
For example you have 5 columns
ID User Kills Deaths Party
Right, then you do a MySQL SELECT query, like this:
SELECT * FROM `table` WHERE ID = 1;
What this actually means is this:
SELECT ID,User,Kills,Deaths,Party FROM `table` WHERE ID = 1;
Now what's the point in getting MySQL to take all of that information from the table, when all you want to do is see how many rows are returned? What you're doing is causing added stress on the server to execute queries and grab loads of information you don't need.
In this case it is not an issue, because there is only five columns and that's not a lot, but some of the bigger servers may have many more columns, and then these SELECT * queries everywhere will really start to become noticeable, I've seen instances where the server actually hangs completely while processing the query.
Although I do believe MySQL plugin is threaded now, so the server won't hang, but you're still gathering a lot of information from the MySQL database that you're not going to use at all in that instance.
I hope this helps
For example you have 5 columns
ID User Kills Deaths Party
Right, then you do a MySQL SELECT query, like this:
SELECT * FROM `table` WHERE ID = 1;
What this actually means is this:
SELECT ID,User,Kills,Deaths,Party FROM `table` WHERE ID = 1;
Now what's the point in getting MySQL to take all of that information from the table, when all you want to do is see how many rows are returned? What you're doing is causing added stress on the server to execute queries and grab loads of information you don't need.
In this case it is not an issue, because there is only five columns and that's not a lot, but some of the bigger servers may have many more columns, and then these SELECT * queries everywhere will really start to become noticeable, I've seen instances where the server actually hangs completely while processing the query.
Although I do believe MySQL plugin is threaded now, so the server won't hang, but you're still gathering a lot of information from the MySQL database that you're not going to use at all in that instance.
I hope this helps