|
-
May 5th, 2013, 09:43 AM
#1
Thread Starter
Hyperactive Member
MySQL 2nd reading speed change
I'll admit I'm still very new to SQL (linux, not MSSql)
My database if very large.
I notice that when i access a row the first time, it's slow.
but when i access it again, it's quick.
because my database is used for gaming, and it's very large, i'm looking at the reason behind this to speed it up.
is there Caching involved?
I noticed there is some improvement by narrowing the search parameter for the row
(for example, here i refer to just the ID of the row instead of all of the values involved in the initial search)
Code:
....
If ($count == 0 )
{
$sql = "INSERT INTO $LandTable (West,North,Type1) VALUES ($West,$North,'$Char')";
mysql_query($sql,$LandCon) or die("error 109 :[$sql]: " . mysql_error());
}
else
{
$info = mysql_fetch_array($result);
$ID = $info['ID'];
$sql = "UPDATE $LandTable SET Type1=$Char WHERE ID = $ID ";// WHERE North = $North AND West=$West";
$result=mysql_query($sql,$LandCon) or die( "error 110: $Char ".mysql_error());
}
echo "SUCCESS DIG ";
}
Any other pointers you can give on how to speed up mySql without having to recode my entire game engine would be greatly appreciated.
EDIT:
more info regarding the particular database in question
size = 3.1 MiB overhead= 450.9 KiB
Last edited by Waxy; May 5th, 2013 at 09:56 AM.
----------------------------------------------------
Missing the days of GWBasic 1.1
WaxyStudios.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|