clickhouse-parts-triageFix ClickHouse too-many-parts errors and merge backlogs by reading system.parts, system.merges and system.part_log before changing anything, then removing the cause in order of frequency: many tiny inserts (batch to tens of thousands to a million rows at about one insert per second per table, or asy
connection-storm-recoveryRecover from and prevent database connection exhaustion and reconnect herds: do the arithmetic first (instances times pool size against max_connections minus superuser_reserved_connections, and the useful ceiling of two to four active backends per core), stop the herd rather than restarting the data
deadlock-analysisTurn a database deadlock error into a code change. Collect the engine's own report, not the application stack trace: PostgreSQL's log entry naming both statements, or MySQL's LATEST DETECTED DEADLOCK section. Lay the two transactions out as a lock-order grid, classify the cycle (opposite-order batch
failover-client-hardeningMake applications survive a database failover in seconds, not minutes, by fixing the client side. Test first: force a real failover (RDS reboot with failover, Patroni switchover) under steady load, record time to first success per service and set the target below it. Then work the causes in order: p
index-pruningSafely find and drop unused, duplicate and invalid indexes to cut write cost and storage. Candidates come from pg_stat_user_indexes with idx_scan = 0 since the last stats reset, summed across the primary and every replica because statistics are per node; constraint-backing and foreign-key indexes ar
innodb-purge-lagDiagnose MySQL InnoDB undo growth and purge lag: measure the history list length (SHOW ENGINE INNODB STATUS or trx_rseg_history_len) as a trend over hours, find the oldest read view that purge cannot pass (information_schema.innodb_trx ordered by trx_started, Sleep-state threads holding an open tran
integer-key-exhaustionAudit and fix 32-bit auto-increment keys before they overflow. Measure every integer identity or serial column against its sequence (pg_sequences last_value as a share of max_value) and MySQL AUTO_INCREMENT against the column type's maximum, referencing foreign-key columns included, rank by days rem
lock-queue-triageUntangle a live blocking chain in PostgreSQL or MySQL: find the head of the chain rather than the victims by walking pg_blocking_pids() to a session that is not itself blocked, or sys.innodb_lock_waits and performance_schema.metadata_locks on MySQL, cancel a waiting ALTER first because it queues eve
postgres-full-text-searchBuild search inside PostgreSQL and know when to stop: decide with numbers first (corpus size, query rate, faceting, synonyms), then add a stored generated tsvector column (PostgreSQL 12 and later) with setweight, a GIN index, websearch_to_tsquery for raw user input instead of to_tsquery, ts_rank_cd
redis-memory-triageWork out why Redis is full, evicting or out of memory: decide whether the instance is a cache, a durable store or a queue (they need different maxmemory-policy values and separate instances), read INFO memory (used_memory against used_memory_rss, overhead, client output buffers, replication backlog)
search-mapping-designDesign Elasticsearch or OpenSearch mappings that stay small, fast and changeable: start from the queries, aggregations and sorts the index must serve, choose text for analysed matching and keyword for exact filters, aggregations and sorts, set dynamic to strict in the index template with dynamic_tem
search-relevance-tuningImprove Elasticsearch or OpenSearch ranking against measured judgments instead of anecdotes: build a graded judgment set first (top queries by volume, zero-result queries, the complaint list, graded 0 to 3 by someone who knows the product, kept in version control), baseline with _rank_eval (NDCG@10,
shard-allocation-triageResolve red or yellow Elasticsearch and OpenSearch clusters and unassigned shards in a fixed reading order: _cluster/health, _cat/shards with unassigned.reason, then _cluster/allocation/explain read decider by decider. Causes in frequency order: disk watermarks (flood stage sets read_only_allow_dele
sqlite-in-productionRun SQLite reliably as the database of a server or desktop application: set the per-connection pragmas (journal_mode WAL, synchronous NORMAL, busy_timeout, foreign_keys ON, PRAGMA optimize before close), keep one writer and a pool of readers, begin every writing transaction with BEGIN IMMEDIATE beca
table-partitioningDecide whether to partition a large PostgreSQL or MySQL table, and do it without an outage. Gate on a named reason (retention by dropping a partition, pruning on a column in nearly every query, or per-partition maintenance); a table that fits in memory with no retention need stays whole. Verify prun
timeseries-retention-downsamplingDesign retention, rollups and compression for a time-series store: compute ingest rate, bytes per point and active series cardinality first, write a resolution-versus-retention table driven by what old data is asked, build the rollup (TimescaleDB continuous aggregate, ClickHouse materialized view in
typeahead-search-designBuild search-as-you-type and autocomplete on Elasticsearch or OpenSearch: pick the mechanism by content (completion suggester for prefixes of curated terms, search_as_you_type with bool_prefix for mid-phrase matching on documents, edge_ngram at index time with a plain standard analyser at search tim
vacuum-bloat-triageDiagnose and fix PostgreSQL table and index bloat when dead tuples keep accumulating: measure first with pgstattuple_approx and pg_stat_user_tables (n_dead_tup, last_autovacuum, autovacuum_count), then find what pins the xmin horizon (oldest backend_xmin in pg_stat_activity, replication slots, prepa
vector-index-tuningTune an approximate nearest-neighbour index against measured recall and latency: compute exact top-k by brute force for about 1,000 sampled real queries, score recall@k as overlap with the index's answers, tune to a stated target such as recall 0.95 at k=10 and a p95 rather than defaults. Covers pgv
xid-wraparound-defenseMonitor and recover from PostgreSQL transaction ID and multixact wraparound risk: read age(datfrozenxid) per database and age(relfrozenxid) and mxid_age(relminmxid) per table oldest first, alert near 500 million of the roughly 2.1 billion ceiling so a page arrives with weeks of runway, and in an eme