Category
MySQL
7 notes.
Type
Tags
7 of 7 notes
No notes match these filters.
- 0011· decision· intermediateScaling MySQL before shardingSharding adds an order of magnitude of complexity. Exhaust the cheaper options first — split the DB onto its own host, add a cache, add read replicas, scale the box up — and only shard when those run out.
- 0010· procedure· introCreate a read-only MySQL userHow to create a least-privilege MySQL account for analytics or support — and the specific grants, host restrictions, and cleanup steps that keep it least-privilege over time.
- 0009· procedure· intermediateALTER TABLE without locking large tablesALGORITHM=INPLACE, LOCK=NONE lets DDL run while reads and writes continue. Works for many but not all alterations — knowing which is the difference between zero downtime and a stuck production.
- 0008· comparison· introOR vs IN vs BETWEEN for multi-value WHEREFor matching a column against several values, IN beats OR by orders of magnitude (binary search vs linear), and BETWEEN beats IN when the values form a contiguous range.
- 0007· procedure· intermediateReading MySQL EXPLAIN outputHow to read the EXPLAIN plan column by column — type, key, rows, filtered, Extra — what the values mean, what to fix, and how the driving table cascades through JOINs.
- 0006· comparison· intermediateEXISTS vs JOIN for filteringJOIN multiplies rows then dedupes; EXISTS short-circuits at the first match. For pure filtering, EXISTS is the semantically correct choice — no DISTINCT, no optimizer roulette.
- 0005· procedure· introSQL execution order for query optimizationThe logical order MySQL runs your SELECT — FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT, ORDER BY/LIMIT — and the optimization hook each stage gives you.