Marcel
Marcel

Reputation: 284

What is the meaning of totalSlotMs for a BigQuery job?

What is the meaning of the statistics.query.totalSlotMs value returned for a completed BigQuery job? Except for giving an indication of relative cost of one job vs the other, it's not clear how else one should interpret the number. For example, how does the slot-milliseconds number relate to the stack driver reported total slot usage for a given project (which needs to stay below 2000 for on demand BigQuery usage)?

The docs are a bit terse ('[Output-only] Slot-milliseconds for the job.')

Upvotes: 5

Views: 7879

Answers (1)

Guillem Xercavins
Guillem Xercavins

Reputation: 7058

The idea is to have a 'slots' metric in the same units at which slots of reservation are sold to customers.

For example, imagine that you have a 20-second query that is continuously consuming 4 slots. In that case, your query is using 80,000 totalSlotMs (4 * 20,000).

This way you can determine the average number of slots even if the peak number of slots differs as, in practice, the number of workers will fluctuate over the runtime of a query.

Upvotes: 7

Related Questions