24.05.2015, 11:08
Executing a query for selecting all the data from the table is the best option (like you have it) rather than those bad methods which use loops and executing hundreds of queries.
The only real improvement of your code is to update to R39-3 as the performance of the plugin has been improved a lot. By that, you'll call functions that return integer/floating point numbers directly so you won't have to store it to a temporary string and use strval/floatstr functions. Also if you know the order of the fields, you can use the field ID (cache_get_row/cache_get_row_*) instead of the field name which is slightly faster.
The only real improvement of your code is to update to R39-3 as the performance of the plugin has been improved a lot. By that, you'll call functions that return integer/floating point numbers directly so you won't have to store it to a temporary string and use strval/floatstr functions. Also if you know the order of the fields, you can use the field ID (cache_get_row/cache_get_row_*) instead of the field name which is slightly faster.