Differentiation between query executed on on demand pricing and flat rate pricing in bigquery

Viewed 40

In GCP bigquery, there are two types of pricing 1) On demand 2) Flat rate pricing.

I have two projects one is configured with on-demand, other one is configured with flat rate pricing. Now when i executes a query on two projects, i need to know the differentiation between the query executed on on-demand pricing and flat rate pricing. In the GUI, we can know the difference .

Flat Rate Pricing

enter image description here

On demand pricing

enter image description here

But through bigquery libraries i am calling the bigquery API to get the job Object by jobId. In that i am unable to find the difference between those queries , atleast i expected some info related to reservation in the flat rate pricing query, but there is no luck. I need this info in our monitoring tool to identify the difference between the queries that are executed on on-demand and flat rate.

One analysis i found was through information schema we can get the info, but i am more interested at the API level through bigquery java libraries.

1 Answers

In the Get job API, you get a JOB object. In it, you have a JobStatistic entry. In this entry, you have the reservation detail

enter image description here

Related