Results 1 to 8 of 8

Thread: MySQL 2nd reading speed change

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2004
    Posts
    259

    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
  •  



Click Here to Expand Forum to Full Width