Skip to content
Tagged articles

Approximate Algorithms

2 articles · Page 1 of 1
IT Services Circle
IT Services Circle
Nov 3, 2026 · Databases

MySQL Top 10 from 50M Rows: SQL Pitfalls, Pre-aggregation & Space-Saving Algorithm

This article walks through a big-tech interview question about finding top 10 hot items from 50M MySQL rows, revealing why naive SQL fails, how to clarify time windows and real-time needs, and explores solutions from pre-aggregated snapshots and partitioned parallel queries to the Space-Saving algorithm for approximate top-K with bounded memory.

Approximate AlgorithmsDatabase InternalsMySQL
0 likes · 14 min read
MySQL Top 10 from 50M Rows: SQL Pitfalls, Pre-aggregation & Space-Saving Algorithm
Code Wrench
Code Wrench
Jan 24, 2026 · Backend Development

Mastering Approximate Top‑K: Scalable Hotspot Detection for Go Backends

When a small fraction of requests overwhelms a system, understanding which endpoints, keys, or users cause the bottleneck is crucial; this article explains why traditional full‑count sorting fails at scale, introduces efficient approximate Top‑K algorithms such as fixed‑size min‑heap and Count‑Min Sketch, and provides production‑ready Go implementations with practical usage patterns and performance benchmarks.

Approximate AlgorithmsBackenddata structures
0 likes · 15 min read
Mastering Approximate Top‑K: Scalable Hotspot Detection for Go Backends