04.07.2014, 19:03
Quote:
|
The first one is out of the question. Running multiple queries is never a good idea when you can just run one query to get the same data.
Now, from what I can see the only real difference between the last two is the "cache_get_field_" functions. I would imagine it's faster to just address each row by ID (one cell) rather than a string (a bunch of cells) but I'm not sure how MySQL works internally for that. The second looks way easier to write though and you don't need to mess around with a cache variable to store the value in then assign that to the target (also I noticed that requires using strval/floatstr). The second option looks like the best method. |
Your query would look like
pawn Code:
SELECT model, x, y, z, angle, col1, col2, respawn FROM Vehicules
Quote:
|
Originally Posted by http://code.tutsplus.com/tutorials/top-2...--net-7855
Avoid SELECT *
The more data is read from the tables, the slower the query will become. It increases the time it takes for the disk operations. Also when the database server is separate from the web server, you will have longer network delays due to the data having to be transferred between the servers. It is a good habit to always specify which columns you need when you are doing your SELECT's. |

