global level, some per connection! ‣ Know some quirks: (max_heap_table_size vs tmp_table_size, binlog- do-db, replicate-ignore-db etc) 9 woensdag 25 april 12
RESTORE TABLE x? YES! YES I CAN! ‣ mysqldump can dump per database OR by table. ‣ Simple scripts to scan/dump tables. ‣ Easy restore for single table (or part of table) 12 woensdag 25 april 12
DON’T NEED ‣ Much more data to be read from disk ‣ Much more data will be send over, thus slower (blobs/texts) ‣ Cannot use covering indices 14 woensdag 25 april 12
‣ 6 triggers per table (insert, update, delete, before and after the mutation) ‣ 3rd party tools (phpmyadmin etc) can also use the database without loosing data consistency. 17 woensdag 25 april 12
‣ 6 triggers per table (insert, update, delete, before and after the mutation) ‣ 3rd party tools (phpmyadmin etc) can also use the database without loosing data consistency. ‣ Watch out with (phpmyadmin) table dumps! 17 woensdag 25 april 12
MUCH BETTER SOLUTIONS ‣ They only work for MyISAM tables. ‣ Not compatible with other DB’s. ‣ Slow (especially compared to Solr, Sphinx). 19 woensdag 25 april 12
MUCH BETTER SOLUTIONS ‣ They only work for MyISAM tables. ‣ Not compatible with other DB’s. ‣ Slow (especially compared to Solr, Sphinx). ‣ No extra features (faceted search, spell checking etc). 19 woensdag 25 april 12
SOLUTIONS ‣ MySQL cannot use indexes! ‣ Revert your data: search for ‘moc.esirne@%’ instead of ‘%@enrise.com’. ‣ Use a better solution (solr, sphinx). You probably want it. 21 woensdag 25 april 12
queries referring to that table. ‣ UPDATE pages SET hit_count = hit_count + 1; ‣ Thus: page table will NEVER be cached. Tip 8: Sharding (2) 24 woensdag 25 april 12
(static, changes never or infrequently) ‣ move to different tables ‣ UPDATE page_stats SET hit_count = hit_count + 1; Tip 8: Sharding (3) 25 woensdag 25 april 12
(static, changes never or infrequently) ‣ move to different tables ‣ UPDATE page_stats SET hit_count = hit_count + 1; ‣ Query cache is happy again Tip 8: Sharding (3) 25 woensdag 25 april 12
EXAMS, BUT WELL WORTH IT ‣ Oracle Certified MySQL Associate ‣ Oracle Certified Professional MySQL 5.0 Developer ‣ Oracle Certified Professional MySQL 5.0 Database Administrator ‣ Oracle Certified Expert, MySQL 5.1 Cluster Database Administrator. ‣ Get them all! 51 woensdag 25 april 12
the most basic my.cnf settings. (3) Backup on table level. (4) Don’t use “SELECT *” when you only need 1 or 2 fields. (5) Use triggers and stored procedures. (6) Don’t use FULLTEXT searches. (7) Wildcard searches (%item%) are bad for performance. (8) Shard your volatile and non-volatile data. (9) Don’t use a large Primary Key for InnoDB tables. (10) Don’t “Select COUNT(*)” on InnoDB. (11) Don’t rely on the VARCHAR(). (12) UTF-8 is not the enemy, but it certainly isn’t your friend. (13) Know your cardinality & selectivity. (14) Non-deterministic functions do not go well with query caching. (15) Certify yourself as a DBA and/or DBE. 52 woensdag 25 april 12