drupflare/worker - v1.0.0
    Preparing search index...

    Function splitChargedRows

    • Divides measured charged rows into data and index maintenance, given the schema's charge factors.

      The exact answer overheadShare() cannot give, and it needs an input that tally alone does not carry: how many charged rows one stored row costs on each table. That comes from the schema -- chargePerInsertedRow() in scripts/measure/index-audit.ts derives it and tests/unit/db/index-charge-model.spec.ts measures it against real Durable Object SQL.

      Reports exact: false rather than rounding when a table's total is not a whole multiple of its factor. A non-integer means the writes were not all fresh single-row inserts, and rounding it away would turn a wrong assumption about the statements into a confident number.

      Parameters

      • charged: Record<string, number>
      • chargePerRow: Record<string, number>

      Returns { dataRows: number; indexRows: number; indexShare: number; rows: ChargeSplit[] }