mysql実行効率最適化に関する注意点とポイント

1972 ワード

1. SQL      :          BLOCK     ,                 。 
    SQL           : 
?      SQL,               
?         SQL                      
?           
?           

2.     SELECT * FROM table   ,        。 

3.    SQL   ,    where            ,     ,  where       。 

4.             。  SELECT         ,            ,      。 

5.                   SELECT COUNT (*) select top 1   。 

6.         ,   SQL   ,       、  ,    SQL          ,         。 

7.       order by        。 

8.            ,          7 。 

9.      IN   OR,    In       。           200 。 

10. <>   < 、 >   ,> >=  ,1000)。         :select name from customer inner join order on customer.customer_id=order.customer_id where order.money>100。 

15.  WHERE    ,         ,   where      ,               。       substring    like  。 

16.        not in(in)  ,    not exists(exists)   ,             。 

17.           ,                      ,                 ,           ,    。 

18.                 order by,group by ,    disti    t。 

19.  union all    union,     union  ,       union     ,        ,         ,       。 
          query A query B         ,   union all  union,       。

        
1.       ,        insert           。 
2.         ,    insert,update,delete          ,         。 

           

    I/O   ,                        ( ORACLE  ): 
?? table index  :table index         tablespace 。 

?? Rollback Segment   :Rollback Segment       Tablespace 。 

?? System Tablespace   :System Tablespace           object。(mssql primary filegroup           object) 

?? Temp Tablesace   :     Temp Tablespace,    user  default Temp Tablespace 

??    : segment         ,            block     。     DML   segemeng  ,          。  ,        DML                   Tablespace 。 

           ,     I/O    ,               。 
??   Table   :              Table,          Taclespace ,   I/O  。 

??     :       Table Index    ,     Tablespace 。 

         ,    RAID。             。