Earlier quoted context omitted.
Their FAQ [1] clarifies this somewhat: > Every time a query retrieves a row from the database, it is counted as a row read. Every time a row is written to the database, it is counted as a row written. [1] https://planetscale.com/pricing (FAQ at bottom of the page)
> Reads: Retrieving or inspecting rows during a query or mutation of any kind to your PlanetScale databases That's what the detailed pricing page says, which is somewhat different. The pricing is actually per row inspected, not per row returned to the client. So in aggregations you'd pay for every single row you aggregate. So I'd argue that the FAQ is actually misleading.
Like others say, the end user doesn’t have a lot of control over how the query planner does its magic. They do have control over what goes into and out of the system though.
That being said things like Google BigQuery bill by compute time and data examined so I guess that works as long as the price per “unit” is on the order of millicents or something.