PHP's biggest bottleneck, MySQL
summary
Claim: PHP slowness often traces to MySQL not PHP. Practical fixes and measurements include adding indexes to cut a 25,000-row lookup from ~0.3–0.6s to ~0.006s, using covering index to avoid table reads, running EXPLAIN plan to see rows scanned, moving complex filtering into PHP (a 70,000-row great‑circle query halves from ~0.04s to ~0.02s), enabling query cache hits, choosing MyISAM vs InnoDB by read/write profile, enabling the slow query log and always benchmarking changes.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:06The problem with MySQL
- 2:09Simple fixes
- 3:32Indexes
- 4:23Simple example
- 7:46Using an index
- 9:29Storing indexes
- 11:29Explain
- 12:20Explain example
- 13:59Explain example 2
- 19:01What is query caching
- 20:32Configure query caching
- 22:52Choose the right storage engine
- 25:09Use a slow query log
- 26:55Example slow query log
- 28:09Slow query definition
- 29:32Understanding data types
- 33:32User table example
- 35:47Questions
- 42:28Procedures
related talks
35mSlow database in your PHP stack? Don't blame the DBA!
34mMySQL and InnoDB Performance for the Rest of Us
39mPHP Performance Demystified - Measure, Understand, Optimise
53mEfficient MySQL Performance
54mBottleneck Analysis
55mLet's Talk About MySQL Query Tuning
21mWriting High Performance SQL Statements
49m18 Ways to Fix MySQL Bottlenecks
