Apex › Storage & databases
Columnar storage — dictionary + RLE encoding
Why Parquet, Arrow, and ClickHouse store tables by column, not by row. A column store reads only the columns a query touches, and puts similar values next to each other so they compress with cheap, vectorizable schemes: dictionary encoding (distinct values → narrow integer codes) and run-length encoding (a run of equal codes → one (code, count) pair). Pick a column profile — sorted low-cardinality, shuffled, or unique IDs — and watch raw → dictionary → +RLE bytes and the ratio: sorted low-cardinality shrinks 100×+, shuffling loses RLE, and unique IDs defeat the dictionary entirely. The OLAP half of the row-vs-column split.
More in Storage & databases
- B+tree index
- How a hash index grows (extendible hashing)
- How Git stores your code
- LSM-tree
- Page replacement
- MVCC isolation
- Write-Ahead Log
- Skip list
- Locking & deadlock
- When is an interleaving safe? (conflict serializability)
- Join algorithms
- How to join tables bigger than RAM (grace hash join)
- Query planner (cost)
- RUM amplification
- Trie (prefix tree)
- HAMT (persistent map)
- Hash table collisions
- Cuckoo hashing
- Cuckoo filter
- Robin Hood hashing
- Geohashing
- k-d tree (nearest neighbor)
- Union-Find
- Fenwick tree
- Sparse table (RMQ)
- Cartesian tree (RMQ=LCA)
- Roaring bitmaps
- Bitmap index
- Learned index
- Binary heap
- Pairing heap (mergeable)
- Segment tree
- Interval tree
- AVL tree
- Splay tree
- Treap (randomized BST)
- Piece table (text editor)
- Rope (text editor tree)
- Gap buffer (Emacs)
- The sort in your standard library (Timsort)
- Sorting algorithms
- Kadane (max subarray)
- Longest increasing subseq
- Quickselect (k-th)
- Median of medians
- Dutch national flag
- Shuffle bias (Fisher–Yates)
- Alias method (weighted sampling)
- Estimating π by throwing darts (Monte Carlo)
- Fitting a line through 50% outliers (RANSAC)
- KMP string search
- Rabin-Karp
- Aho-Corasick
- Boyer-Moore search
- Suffix array
- Manacher (palindromes)
- Z-algorithm
- Edit distance
- How diff works (git diff, code review)
- How fuzzy search finds typos (BK-tree)
- 0/1 Knapsack (DP)
- Topological sort
- A* pathfinding
- How a SAT solver works (DPLL)
- Max-flow / min-cut
- Minimum spanning tree
- Strongly connected comps
- 2-SAT (implication graph)
- Floyd-Warshall (all-pairs)
- Cycle detection (tortoise & hare)
- Bellman-Ford & arbitrage
- How Google first ranked the web (PageRank)
- How k-means finds clusters (unsupervised)
- Clustering any shape + finding outliers (DBSCAN)
- Soft clustering with Gaussians (GMM / EM)
- How PCA compresses data (principal components)
- How SVD compresses an image (low rank)
- The first neural net (perceptron & XOR)
- From a hard line to a probability (logistic regression)
- The widest street between classes (SVM)
- How a decision tree splits data (Gini)
- Why a forest beats one tree (bagging)
- Learning from residuals (gradient boosting)
- Newton's method
- How conjugate gradient beats zigzag descent
- How linear programming finds the best plan (simplex)
- Fast Fourier Transform
- Two oscillators, a thousand timbres (FM synthesis)
- Multi-resolution & compression (Haar wavelet)
- How a phone hears touch-tones (Goertzel)
- How a tuner hears pitch (autocorrelation)
- How to synthesize a plucked string (Karplus-Strong)
- The shape of every note (ADSR envelope)
- How reverb puts you in a cathedral (convolution)
- The filter inside every EQ (biquad)
- Fast inverse square root
- Kahan summation
- How calculators do trig (CORDIC)
- Karatsuba multiplication
- Simulated annealing
- How game AI searches (alpha-beta)
- How a neural network learns (backprop)
- How word embeddings work (word2vec)
- How vector search finds nearest embeddings (HNSW)
- How attention works (transformers)
- Mixture of Experts (MoE)
- Speculative decoding
- KV cache & PagedAttention
- Weight quantization (int4/int8)
- Bresenham line drawing
- How curves are drawn (Bézier & de Casteljau)
- How ray tracing renders an image
- How a GPU rasterizes a triangle
- How 3D becomes 2D (perspective & the texture warp)
- How GPUs smooth jagged edges (MSAA)
- How game physics simulates rope & cloth
- How galaxies simulate gravity fast (Barnes-Hut)
- Why the weather is unpredictable (chaos)
- Why simulated orbits drift (symplectic integrators)
- How ray-marching renders with math (SDF)
- How 3D rotation really works (quaternions & slerp)
- Convex hull
- How games detect collisions (SAT)
- How games skip the n² collision test (spatial hash)
- Marching squares
- Voronoi diagram
- Delaunay triangulation
- Generating maps by constraints (wave function collapse)
- Perlin noise
- Poisson-disk sampling