What will be faster, MySQL or for loop?
#1

For Example if we have MySQL Table with fields: id and nick we can use the next code to get nick:
Code:
new query[64];
mysql_format(MySQLHandler, query, sizeof(query), "SELECT `nick` FROM `TableTest` WHERE `id`=%d", testValue);
mysql_pquery(MySQLHandler, query, "funTest");
[...]
forward funTest();
public funTest()
{
 new a[32];
 cache_get_row(0, 0, a);
 print(a);
 return 1;
}
And We have also:
Code:
for(new i; i < MAX; i++)//MAX is integer const
{
 if(i == testValue)//testValue is a variable that we can change, it is only example, above also
  print(tab[i];//tab is table of nicks
}
My question is: what will be faster, MySQL query on localhost or for loop? For small tabs it for loop will be faster, but what, if we will have 2000 elements?
Reply


Messages In This Thread
What will be faster, MySQL or for loop? - by PaSaSaP - 02.03.2015, 07:27
Re: What will be faster, MySQL or for loop? - by rickisme - 02.03.2015, 08:27
Re: What will be faster, MySQL or for loop? - by Vince - 02.03.2015, 09:11

Forum Jump:


Users browsing this thread: 1 Guest(s)