Skip to content
dbexplore

Inform

Postgres cost attribution: every dollar traced to the query behind it.

An invoice tells you which cluster cost what. Attribution tells you which workload, table, index or statement made the cluster that size, how sure anyone can be, and what the people kept waiting were worth.

Why the invoice cannot answer the question people ask

Ask who spent last month’s Postgres money and the invoice names an instance. That is a true answer to a question nobody asked. What people want to know is which service, which team, which query. Everything between the instance and the statement is shared: a primary serves dozens of services, a replica carries the reporting, and the I/O charge is one line for every read the cluster did.

Informing is the work of dividing those shared lines fairly, and of saying how fair the division is. It is the first step of the FinOps loop, and the one every later step stands on: a queue of opportunities or a budget is only as good as the attribution under it.

Usage times a rate, and the part left over

Every figure is a quantity multiplied by a price. The agent measures the quantity: compute hours or capacity units, storage held, I/O requests, data sent out, backups retained, and on a separate axis the hours people spend waiting on the database. The price is a rate with the source it came from, and the dollar that results carries the basis of the rate that priced it.

Look at the lower half of the drawing, which is the part most cost tools leave out. Some dollars land on a statement. Some can be pinned to a database and no further. And some cannot be explained at all, and that remainder gets its own dashed slice. It is never spread across the rest to make the total look fully attributed, because a total that looks complete is exactly what finance stops trusting first.

Usage compute hours, storage, I/O, data transferred × Rate price per unit, with the source it came from = Dollars always carry a basis in plain words One basis on every figure: list price your rate your bill Where the dollars land Attributed to a statement To a database only Unattributed remainder The remainder is drawn, never spread across the rest to make the total look fully attributed.
Dollars are usage times a rate, and every dollar carries the basis of its rate. The dashed slice is what cannot be explained.

A rate card with a row for everything metered

The tenant rate card has a row for each thing that is metered: compute, storage, I/O, backup, transfer and observability, with the rows varying by platform, so no card shows a line that its platform cannot incur. The people-hour is a row of its own, labelled apart, and it reads “not configured” until you enter one, never a guessed figure. The card starts from public prices for your region and platform, and you replace any row with what you pay. Changing a row re-prices every figure that rests on it.

Your rate always wins. Where a row has no price from you, the public price for that cloud and region is used, and where even that is missing a stand-in is used and labelled as one. A figure keeps the basis of whatever priced it, so the pill is a record and not a decoration.

From an invoice line down to a statement

The invoice is the only authority in the chain, so attribution starts there and loses certainty at every step down. Each step apportions from measured usage, each answer is finer than the last and less certain, and a statement’s dollars are an estimate sitting inside a billed total, labelled as one.

each step asks a finer question, and authority falls at each step Invoice line the amount the provider billed billed Cluster a share of the invoice line, from measured usage apportioned Database a share of the cluster, from measured usage apportioned Workload a share of the database, from measured usage estimated Statement a share of the workload, from measured usage estimated A statement's dollars are an estimate inside a billed total, and are labelled as one.
Authority falls at each step down. The estimate at the bottom is real and useful, and it is never presented as a bill.

What that buys is a ranking you can act on and a proportion you can argue about. The cost-of-code screen lists the heaviest statements in dollars and says plainly how much of the cost is attributed and how much is not. The same cluster can be cut by object: instance, replica, table, index, statement. Owner is a cut too, and the next step in the loop, showback, is built on it.

Cost of code

illustrative basislist price

One database for a month: the heaviest statements, in dollars.

Heaviest statements, per month

list price
  • Open orders for a customer $1,790

    Cheap per call, called constantly

  • Nightly revenue rollup $1,260
  • Search suggestions $960
  • Cart totals $720
  • Audit export $510

One cheap kind of finding sits among the object cuts. An index that nothing reads costs storage and slows every write, and how to find those indexes is a guide of its own. The index advisor already prices the write side of keeping it.

Waiting is a cost, and no invoice carries it

A transaction stuck behind a lock does not change the instance bill by a cent. It holds up a person, or a service that a person is paid to keep running, and that is a cost too. Wait time is shown as time first, because hours are what the database measured.

People time is shown separately. Priced at a people-hour rate you enter, it is labelled as people time and never added to the infrastructure total, because mixing them would make every database look more expensive and every comparison with an invoice wrong. Where waits come from is covered in lock contention and blocking trees and active session history.

Anomalies, incidents and a forecast

A cost that moves unexpectedly is worth a message, and so is a budget crossing a threshold. Both arrive through the same notification path as the rest of the alerts, with no second alerting system to configure, and each one names the object that moved.

When something does go wrong, the first question after “is it fixed” is “what did that cost”. The cost of an incident and a forecast against a budget sit on the same numbers as everything else on this page, with the people time kept on its own line.

What informing leads to

An attributed number is a place to start. Optimize turns what informing found into a queue with owners and a dollar delta on every proposed change. Operate keeps the numbers in front of the people who can change them. The trust page explains why any of these dollars can be believed, and the cost optimization overview shows where each platform leaks. For how a missing price is resolved down the rate card, see how a database rate card works.

Start with attribution on your own clusters.

A pilot is read-only. You get the cost of code, the rate card and the anomaly view on real clusters before anything is allowed to change.