MySql (optimization)
#1

Simple question

Is it better to use big query's and fetch

pawn Код:
new Query[200]; //Creates the Query string and the Pname
    format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `User` = '%s'", ESCpName);
    mysql_query(Query);
And now fetch row (it will be very big and its very hard to script it)
Or use it like
pawn Код:
stock GetFromAccount(username[], obtaining[], holdingvar[])
{
    format(Query, sizeof(Query), "SELECT `%s` FROM `Accounts` WHERE `Username` = '%s'", obtaining, username);
    mysql_query(Query);
    mysql_store_result();

    if(mysql_fetch_row(holdingvar) == 1)
    {
        mysql_free_result();
    }
    return 1;
}
These one is easy way same like wirh DINI or DJSON but i think it will be slower than fetch row....


So what you say? what is better for server speed?
Reply


Messages In This Thread
MySql (optimization) - by DRIFT_HUNTER - 18.01.2011, 03:53
Re: MySql (optimization) - by Grim_ - 18.01.2011, 04:08
Re: MySql (optimization) - by DRIFT_HUNTER - 18.01.2011, 04:20
Re: MySql (optimization) - by Grim_ - 18.01.2011, 05:51
Re: MySql (optimization) - by Not available - 18.01.2011, 07:03
Re: MySql (optimization) - by Calgon - 18.01.2011, 09:05

Forum Jump:


Users browsing this thread: 1 Guest(s)