How fast should be loading 600 houses?
#10

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
Do you still use this:
PHP код:
for(new 0661i++) mysql_pquery(server"SELECT * FROM houses""LoadHouses","d",i); 
Or this:
PHP код:
mysql_tquery(server"SELECT * FROM houses""LoadHouses",""); 
If you still use the first (a loop to load the entire table 662 times), then yes, 47 seconds is normal. Because you're loading 662 houses 662 times, that would be 438244 houses to load.

For the second, this should be loaded within one second as you only send 1 query instead of 662 queries.
The query already loads ALL houses from the table at once, there is no need to loop through each house separately and send a query for each house.
yeah. I load already second type.
Like:
Код:
mysql_tquery(server, "SELECT * FROM houses", "LoadHouses");
and:

Код:
forward LoadHouses();
public LoadHouses()
{
	new time = GetTickCount();
	for(new b; b != 660; ++b)
	{
	    House[b][hID] = cache_get_row_int(b, 0);
	    House[b][hEnterX] = cache_get_row_float(b, 1);
	    House[b][hEnterY] = cache_get_row_float(b, 2);
	    House[b][hEnterZ] = cache_get_row_float(b, 3);
	    House[b][hExitX] = cache_get_row_float(b, 4);
	    House[b][hExitY] = cache_get_row_float(b, 5);
	    House[b][hExitZ] = cache_get_row_float(b, 6);
	    House[b][hCarX] = cache_get_row_float(b, 7);
	    House[b][hCarY] = cache_get_row_float(b, 8);
	    House[b][hCarZ] = cache_get_row_float(b, 9);
	    House[b][hCarC] = cache_get_row_float(b, 10);
	    cache_get_row(b, 11, House[b][hOwner]);
	    House[b][hCost] = cache_get_row_int(b, 12);
	    House[b][hInt] = cache_get_row_int(b, 13);
	    House[b][hVW] = cache_get_row_int(b, 14);
	    House[b][hLock] = cache_get_row_int(b, 15);
	}
    printf("%d ms",GetTickCount()-time);
}]
this need ~45k ms = 45 seconds to load.
Reply


Messages In This Thread
How fast should be loading 661 houses? - by BloodyRP - 15.04.2016, 13:54
Re: How fast should be loading 600 houses? - by saffierr - 15.04.2016, 13:55
Re: How fast should be loading 600 houses? - by BloodyRP - 15.04.2016, 13:56
Re: How fast should be loading 600 houses? - by Konstantinos - 15.04.2016, 14:41
Re: How fast should be loading 600 houses? - by BloodyRP - 15.04.2016, 15:01
Re: How fast should be loading 600 houses? - by BloodyRP - 15.04.2016, 15:47
Re: How fast should be loading 600 houses? - by Konstantinos - 15.04.2016, 15:49
Re: How fast should be loading 600 houses? - by BloodyRP - 15.04.2016, 15:52
Re: How fast should be loading 600 houses? - by AmigaBlizzard - 15.04.2016, 19:55
Re: How fast should be loading 600 houses? - by BloodyRP - 15.04.2016, 19:59

Forum Jump:


Users browsing this thread: 1 Guest(s)