MySQL optimization of huge table

前端 未结 1 649
萌比男神i
萌比男神i 2020-12-12 18:31

I\'ve been trying to get some speed improvements on a certain SELECT query. The situation is as follows: There is a (in my eyes) huge crossing table. It currently has about

1条回答
  •  攒了一身酷
    2020-12-12 18:58

    Here are some innodb examples that work on large tables of approx. 60 to 500 million rows that demonstrate the advantages of a well designed innodb table and how best to use clustered indexes (only available with innodb)

    MySQL and NoSQL: Help me to choose the right one

    60 million entries, select entries from a certain month. How to optimize database?

    Rewriting mysql select to reduce time and writing tmp to disk

    You will also want to read the following:

    http://dev.mysql.com/doc/refman/5.0/en/innodb-index-types.html

    http://www.xaprb.com/blog/2006/07/04/how-to-exploit-mysql-index-optimizations/

    Once you've sorted out your table designs and optimised your innodb config:

    http://www.mysqlperformanceblog.com/2006/09/29/what-to-tune-in-mysql-server-after-installation/

    http://www.mysqlperformanceblog.com/2007/11/03/choosing-innodb_buffer_pool_size/

    You can try something like:

    start transaction;
    
    insert into target_table (x,y) select x,y from source_table order by x,y;
    
    commit;
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题