Skip to main content

OPERATION_POINTS

Constant OPERATION_POINTS 

Source
pub const OPERATION_POINTS: OperationPoints;
Expand description

The cost of each kind of request, in budget points.

Weighted by what the operation actually costs this server, which is not what it costs a server built differently:

  • A read is a primary-key lookup. It is the unit of cost, priced at 1.
  • A write is the expensive one. Storage is append-only, so a write adds a history row, then deletes and re-inserts that resource’s index rows across the typed index tables — an Observation has 76 search parameters, a Patient 46 — and every bit of it is WAL plus an fsync on the primary, which cannot be scaled out. Hence 25.
  • A search is a bounded indexed SELECT with joins. Real work, but it reads warm shared buffers and can move to a read replica, so 6 rather than the write’s 25.
  • History walks the version chain: heavier than a read, far cheaper than a write.
  • An invocation is an operation whose cost varies by definition; 4 covers the dispatch, and whatever the operation itself does is billed by the reads and writes it performs.

Deliberately not modelled on servers that make search the most expensive operation. With Postgres-backed search the binding constraint is write throughput on the primary, not search CPU.