Masthead Data
  • Introduction
    • What is Masthead Data?
    • Data Anomaly Detection
    • Pipeline and Model Observability
    • Data Quality Scans
    • Metadata management: Column-level lineage and Data Dictionary
  • GET STARTED
    • Quickstart
  • Data Products
    • Data Products
    • Domains
  • COST INSIGHTS
    • Pipeline Costs
      • Compute model adjustments
    • Storage Costs
  • INTEGRATIONS
    • Analytics Hub
    • Looker
    • PagerDuty
    • Power BI
    • Slack
  • Settings
    • Account settings
  • Resources
    • Release Notes
    • Compliance & Trust Center
    • Support
Powered by GitBook
On this page
  • Airflow
  • DBT
  • Looker
  1. COST INSIGHTS
  2. Pipeline Costs

Compute model adjustments

Last updated 4 days ago

The compute model used by a query can be defined based on various configurations:

  • default is the On-demand model,

  • the project/folder or organization parent for the job may be , and then particular types of jobs are using the selected reservation,

  • the query may have .

Using these levels BigQuery offers a lot of flexibility to optimize the compute models across your queries.

Masthead introduces a new level of compute model configuration - technology. Different technologies often follow clear patterns of computational resources better suited for their workload. Masthead provides recommendations when a specific technology offers significant savings and can be optimized with minimal effort. For the most common technologies, we’ve compiled a list of actions to help you update the compute model across all jobs at the technology level.

Airflow

reservation_id = 'RESERVATION_ID'
sql_with_overridden_reservation = f"""SET @@reservation='{reservation_id}';
{your_sql}
"""
BigQueryInsertJobOperator(
    task_id="run_query",
    configuration={
        "query": {
            "query": sql_with_overridden_reservation
        }
    },
    ...
)

DBT

{{ config(
    pre_hook="SET @@reservation='RESERVATION_ID';",
    ...
) }}

SELECT ...

Looker

Fully qualified references for datasets and tables are required (starting with project_id where the data resides). Otherwise BigQuery will be looking for the table in the billing project.

Use to add the SQL statement updating the reservation to be used.

Editing in the Looker connection can run the jobs in a dedicated project which is either assigned to a reservation or uses on-demand capacity.

The service account will require and roles in this project.

assigned to a reservation
a reservation override defined
DBT pre-hooks
Billing Project ID
BigQuery Job User
Service Usage Consumer