[Pawn] Best way to load data from database (MySQL r41) - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] Best way to load data from database (MySQL r41) (/showthread.php?tid=1428) |
Best way to load data from database (MySQL r41) - shane adevaratu - 2020-12-18 What is the most efficient way to load data from the database. For example, how could I make the function below more efficient. Code: function loadDealerShip( ) { The 'ID'?starts at 1 and reaches over 100. RE: Best way to load data from database (MySQL r41) - Pinch - 2020-12-18 Why do you have x and result? RE: Best way to load data from database (MySQL r41) - shane adevaratu - 2020-12-18 Good question.. Is there something else I can do to improve it? Code: function loadDealerShip( ) { RE: Best way to load data from database (MySQL r41) - Pinch - 2020-12-18 Probably not, either way you shouldn't worry to much about 1-time reads, worry about the peak usage queries instead (like writing and reading user data). RE: Best way to load data from database (MySQL r41) - Markski - 2020-12-19 For most intents and purposes that is probably fine. High frequency database operations is what you should worry about as stated by Pinch, and in those cases the best way to optimize is by decreasing frequency (caching). RE: Best way to load data from database (MySQL r41) - shane adevaratu - 2020-12-20 It is more efficient to use this method for most rescues Code: //global compared to this? Code: //local RE: Best way to load data from database (MySQL r41) - Pinch - 2020-12-20 Local, always |