my sql optimization
Post on 18-Oct-2014
179 views
DESCRIPTION
TRANSCRIPT
![Page 1: My sql optimization](https://reader033.vdocuments.mx/reader033/viewer/2022061108/5442d35eb1af9f390a8b47a2/html5/thumbnails/1.jpg)
MySQL OptimizationMarko Novaković
![Page 2: My sql optimization](https://reader033.vdocuments.mx/reader033/viewer/2022061108/5442d35eb1af9f390a8b47a2/html5/thumbnails/2.jpg)
MySQL Optimization
Query Optimization
Database Model
MySQL Configuration
Hardware Issues
![Page 3: My sql optimization](https://reader033.vdocuments.mx/reader033/viewer/2022061108/5442d35eb1af9f390a8b47a2/html5/thumbnails/3.jpg)
Query Optimization
Queries that don't use indexes.
Queries that use SELECT *.
Queries that search full-text fields.
Queries that are not properly limited.
Queries that use ORDER BY unnecessarily.
Insert, update and delete optimization.
![Page 4: My sql optimization](https://reader033.vdocuments.mx/reader033/viewer/2022061108/5442d35eb1af9f390a8b47a2/html5/thumbnails/4.jpg)
Database Model
All tables should have primary keys.
Database should be properly normalized.
Using simpler permissions.
Using char and md5 instead blob.
Do not split columns in more tables.
Specify column if not null and add defaults.
![Page 5: My sql optimization](https://reader033.vdocuments.mx/reader033/viewer/2022061108/5442d35eb1af9f390a8b47a2/html5/thumbnails/5.jpg)
MySQL Configuration
skip-name-resolve
query_cache_size = 16M
log-slow-queries=/var/log/slowqueries.log
MySQL Tuner
![Page 6: My sql optimization](https://reader033.vdocuments.mx/reader033/viewer/2022061108/5442d35eb1af9f390a8b47a2/html5/thumbnails/6.jpg)
Hardware Issues
Number of hard drives / RAID.
RAM memory makes bigger cache.
CPU
Replication
Partitioning