skip to content

MySQL

MySQL runs a large share of the web, and interviews probe it as an engine: InnoDB and its clustered index, gap locks, binlog replication and server tuning.

on this pageshow

explore

questions

page 2 of 2

For a MySQL 8.4 OLTP database that must survive losing its primary, how do you choose between async GTID replicas, semisynchronous replication and an InnoDB Cluster?

level: principalimportance: should knowfreq 35%

basics

~20 s

Choose by tolerated data loss, recovery time, network latency and operating skill. Async GTID replicas are simplest but can lose commits; semisync AFTER_SYNC narrows loss at commit latency; InnoDB Cluster adds consensus and automatic failover with stricter requirements.

open as a page

As the lead for a MySQL fleet, how do you decide whether a large-table change runs as native online DDL, through gh-ost or through pt-online-schema-change?

level: principalimportance: should knowfreq 35%

basics

~20 s

Use MySQL's native INSTANT DDL whenever the change allows it; for changes that rebuild or copy a large hot table, use gh-ost, which reads the binlog and can be throttled, or pt-online-schema-change, which uses triggers but handles foreign keys.

open as a page

Should a team switch MySQL's transaction_isolation from InnoDB's default REPEATABLE-READ to READ-COMMITTED fleet-wide, and what does that trade in locking and correctness?

level: principalimportance: should knowfreq 30%

basics

~20 s

Sometimes: READ COMMITTED drops InnoDB's gap locking for searches and releases locks on non-matching rows, cutting lock waits and gap-related deadlocks, but it takes a fresh snapshot per statement and stops protecting range checks against concurrent inserts.

open as a page

In MySQL Group Replication, how does certification decide whether a transaction commits, and why is single-primary mode the default?

level: middleimportance: nice to knowfreq 25%

basics

~20 s

In MySQL Group Replication, a committing transaction broadcasts its changed rows and writeset; all members receive it in one agreed order, and certification rolls it back if an earlier concurrent transaction changed the same row. Single-primary mode avoids those conflicts.

open as a page

In MySQL, before dropping a suspected-unused secondary index on a large table, how would you test the drop with an invisible index, and what does invisibility leave unchanged?

level: seniorimportance: nice to knowfreq 28%

basics

~20 s

Run ALTER TABLE ... ALTER INDEX idx INVISIBLE, watch plans, the slow query log and Performance Schema, then drop it or make it VISIBLE again instantly. An invisible index is still maintained on writes and still enforces uniqueness.

open as a page

In MySQL 8.4, the optimizer misjudges a skewed, non-indexed column and picks a bad join order; when do you add a histogram, and when an optimizer hint?

level: seniorimportance: nice to knowfreq 32%

basics

~20 s

Add a histogram (ANALYZE TABLE ... UPDATE HISTOGRAM) when a non-indexed column's row estimate is wrong; it fixes every query filtering on it. Use a /*+ ... */ optimizer hint only to pin one statement's plan that better statistics cannot fix.

open as a page

showing 31–36 of 36