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

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -