MySQL gurus needed! (Optimization)
#1

I want to know if anyone knows an optimization for this MySQL code:
pawn Код:
// In a timer each 3 minutes
foreach(Player, i)
{
    format(gQuery, sizeof(gQuery), "SELECT * FROM `Tests` WHERE `IP` = '%s'", gPIP[i]);
    mysql_query(gQuery, THREAD_TEST, i);
}
This is the thread code:
pawn Код:
case THREAD_TEST:
{
    mysql_store_result();

    if(IsPlayerConnected(extraid))
    {
        mysql_retrieve_row();

        mysql_get_field("Test1", iResult);
        mysql_get_field("Test2", iResult);
        mysql_get_field("Test3", iResult);
        mysql_get_field("Test4", iResult);
        mysql_get_field("Test5", iResult);
        mysql_get_field("Test6", iResult);
        mysql_get_field("Test7", iResult);
    }
    mysql_free_result();
}
There's around 50 columns in that table. Is there a way to just select those 7 results without getting the entire row?

Also, if anyone knows of a way to optimize the first query check(Loop part), please let me know. I'm afraid this might lag after a few players come online(20ish or so).
Reply


Messages In This Thread
MySQL gurus needed! (Optimization) - by -Prodigy- - 01.02.2012, 09:22
Re: MySQL gurus needed! (Optimization) - by cessil - 01.02.2012, 09:48
Re: MySQL gurus needed! (Optimization) - by Vince - 01.02.2012, 09:52
Re: MySQL gurus needed! (Optimization) - by -Prodigy- - 01.02.2012, 09:55
Re: MySQL gurus needed! (Optimization) - by Dokins - 01.02.2012, 12:02

Forum Jump:


Users browsing this thread: 1 Guest(s)