L
ler
Гость
Вот что выдает mysql tuner
1. Просветите как узнать для каких полей нужны индексы в базе?
2. И будет ли базе плохо если я для всех полей сделаю индексы?
3. Кто хорошо знаком с базой, подскажите в каких полях индексы обязательны, а где вовсе не нужны
Код:
# perl mysqltuner.pl
>> MySQLTuner 1.3.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:
[OK] Currently running supported MySQL version 5.5.38-log
[OK] Operating on 32-bit architecture with less than 2GB RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED -InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 80M (Tables: 602)
[--] Data in MRG_MYISAM tables: 868K (Tables: 1)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 39
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 8d 0h 44m 22s (24M q [35.481 qps], 3M conn, TX: 16B, RX: 2B)
[--] Reads / Writes: 52% / 48%
[--] Total buffers: 640.0M global + 1.3M per thread (500 max threads)
[OK] Maximum possible memory usage: 1.3G (68% of installed RAM)
[OK] Slow queries: 0% (355/24M)
[OK] Highest usage of available connections: 42% (214/500)
[OK] Key buffer size / total MyISAM indexes: 128.0M/30.4M
[OK] Key buffer hit rate: 100.0% (844M cached / 41K reads)
[OK] Query cache efficiency: 40.3% (2M cached / 6M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 5% (68K temp sorts / 1M sorts)
[!!] Joins performed without indexes: 8149
[OK] Temporary tables created on disk: 18% (288K on disk / 1M total)
[OK] Thread cache hit rate: 99% (346 created / 3M connections)
[!!] Table cache hit rate: 2% (1K open / 62K opened)
[OK] Open file limit used: 42% (1K/4K)
[OK] Table locks acquired immediately: 98% (10M immediate / 10M locks)
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
Increase table_cache gradually to avoid file descriptor limits
Read this before increasing table_cache over 64: http://bit.ly/1mi7c4C
Variables to adjust:
join_buffer_size (> 640.0K, or always use indexes with joins)
table_cache (> 2048)
1. Просветите как узнать для каких полей нужны индексы в базе?
2. И будет ли базе плохо если я для всех полей сделаю индексы?
3. Кто хорошо знаком с базой, подскажите в каких полях индексы обязательны, а где вовсе не нужны