mysql - How to speed up my sql queries? -


i have huge database (mysql) 7 tables (1000000 record each) use simple queries call information :

select * matches match_date='$date' select * countries country_id in (select country_id tournaments id='$id') select * tournaments id='$id' 

i use indexing columns in clause query being faster bit.

does have helping ideas improve speed exponentially?

the worst request seems one:

select         *        countries         country_id in ( select      country_id        tournaments      id='$id') 

try use this:

select        countries.*        countries inner join       tournaments on       countries.country_id=tournaments.country_id ,        tournaments.id=$id 

index these columns:

  1. countries.country_id
  2. tournaments.country_id
  3. tournaments.id

and better use columns names instead of *.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -