Created
          February 15, 2011 15:17 
        
      - 
      
 - 
        
Save dgouyette/827634 to your computer and use it in GitHub Desktop.  
    explain et index
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //Affiche les index positionnés sur ma table | |
| SHOW INDEX FROM MA_TABLE | |
| SELECT | |
| * | |
| FROM | |
| tblA, | |
| tblB, | |
| tblC | |
| WHERE | |
| tblA.col1 = tblB.col1 | |
| AND tblA.col2 = tblC.col1; | |
| And EXPLAIN for the query: | |
| +-------+------+---------------+------+---------+------+------+-------------+ | |
| | table | type | possible_keys | key | key_len | ref | rows | Extra | | |
| +-------+------+---------------+------+---------+------+------+-------------+ | |
| | tblA | ALL | NULL | NULL | NULL | NULL | 1000 | | | |
| | tblB | ALL | NULL | NULL | NULL | NULL | 1000 | Using where | | |
| | tblC | ALL | NULL | NULL | NULL | NULL | 1000 | Using where | | |
| +-------+------+---------------+------+---------+------+------+-------------+ | |
| see http://hackmysql.com/case4 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment