Se você é o InnoDB e também se você tem índices que a tabela OPTIMIZE vai levar tempo, descarte índices e então execute a tabela OPTIMIZE e então adicione os índices de volta.
Eu usei o sintonizador mysql e aqui estão as estatísticas. A recomendação diz para otimizar tabelas. Eu tenho 96 GB de memória na máquina. Existe alguma maneira que eu possa acelerar o processo de otimização? As tabelas são tão grandes quanto 1TB. Você tem alguma recomendação sobre como acelerar a tabela de otimização para tabelas grandes?
>> MySQLTuner 1.2.0 - Major Hayden
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.11
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 10270G (Tables: 1263)
[--] Data in MRG_MYISAM tables: 5G (Tables: 2)
[--] Data in InnoDB tables: 39G (Tables: 278)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 277
-------- Performance Metrics -------------------------------------------------
[--] Up for: 11h 49m 35s (46K q [1.090 qps], 9K conn, TX: 141M, RX: 8B)
[--] Reads / Writes: 91% / 9%
[--] Total buffers: 38.0G global + 272.4M per thread (151 max threads)
[OK] Maximum possible memory usage: 78.2G (81% of installed RAM)
[OK] Slow queries: 2% (1K/46K)
[OK] Highest usage of available connections: 8% (13/151)
[OK] Key buffer size / total MyISAM indexes: 36.0G/645.0G
[OK] Key buffer hit rate: 99.7% (1B cached / 3M reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (3 temp sorts / 7K sorts)
[OK] Temporary tables created on disk: 0% (10 on disk / 6K total)
[OK] Thread cache hit rate: 99% (13 created / 9K connections)
[OK] Table cache hit rate: 96% (224 open / 231 opened)
[OK] Open file limit used: 7% (290/4K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)
[!!] InnoDB data size / buffer pool: 39.6G/2.0G
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
Variables to adjust:
query_cache_size (>= 8M)
innodb_buffer_pool_size (>= 39G)
Obrigado - Bala
Se você é o InnoDB e também se você tem índices que a tabela OPTIMIZE vai levar tempo, descarte índices e então execute a tabela OPTIMIZE e então adicione os índices de volta.