Skip to content
Opensource internals
  • Posts

Concurrency

How ClickHouse Runs a Query Pipeline on N Threads: Task Queues, Work Stealing and Growing the Pool

Oct 21, 2026 20 min read Jay Hubbert

A query plan in ClickHouse is not one pipeline. It is a stack of pipelines: read from storage, filter, project, aggregate, sort, format. Each stage produces many parallel streams, …

ClickhouseInternalsQuery executionConcurrency

Read more →

How ClickHouse Runs a Query Pipeline: Ports, Status Codes and the Executing Graph

Oct 21, 2026 19 min read Jay Hubbert

Every query engine eventually has to answer the same question: given a graph of operators — read these files, filter these rows, group them, sort them, write them out — in what …

ClickhouseInternalsQuery executionConcurrency

Read more →

How PostgreSQL Waits for Locks

Oct 6, 2026 49 min read Jay Hubbert

Every lock in PostgreSQL is a bet. When a backend wants a resource that somebody else has, it has to choose: burn CPU waiting, or go to sleep and let the kernel schedule somebody …

PostgresPerformanceConcurrencyInternals

Read more →

How PostgreSQL Locks Buffers Without LWLocks

Oct 2, 2026 42 min read Jay Hubbert

Every time PostgreSQL reads a page it does two things: it pins the shared buffer that holds the page, and it takes a content lock on that buffer so that nobody rewrites the bytes …

PostgresPerformanceStorageConcurrencyInternals

Read more →

How PostgreSQL Locks Tables Fast

Aug 6, 2026 36 min read Jay Hubbert

Ask PostgreSQL how many locks it takes and the honest answer is “it depends, and the interesting part is which lock you’re talking about”. The src/backend/storage/lmgr/README file …

PostgresPerformanceConcurrencyInternals

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·