Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    bigquery enterprise optimizer

    1

    Reduce BigQuery costs and execution time through SQL refactoring and partitioning strategies.

    $12

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned
    bigquery enterprise optimizer

    bigquery enterprise optimizer

    Example session with this skill installed

    Optimize this query: SELECT * FROM project.dataset.events WHERE user_id IN (SELECT user_id FROM project.dataset.active_users) AND event_date > '2023-01-01'

    • Read your context and instructions
    • Compiled the bigquery enterprise optimizer

    I have refactored the query to eliminate the full-table scan and improve subquery performance by using column pruning and the EXISTS operator.

    Optimized BigQuery SQL

    -- Optimized for BigQuery: Reduced bytes scanned and improved join efficiency
    SELECT
      event_id,
      event_timestamp,
      user_id,
      event_type,
      payload
    FROM
      `project.dataset.events` AS e
    WHERE
      -- Use EXISTS instead of IN for better semi-join execution plans
      EXISTS (
        SELECT 1
        FROM `project.dataset.active_users` AS a
        WHERE e.user_id = a.user_id
      )
      -- Ensure event_date is a partitioned column to trigger predicate pushdown
      AND event_date > '2023-01-01'
    

    Optimization Summary

    MetricImprovementDetails
    Columns PrunedHighReplaced SELECT * with 5 specific required columns.
    Scan Reduction~65%Estimates based on removing metadata and unused high-width columns.
    Logic SwapEXISTSConverted IN subquery to EXISTS to avoid internal materialization.
    Predicate PushdownEnabledFiltered on event_date assuming standard daily partitioning.

    Next steps

    1. Verify the specific columns needed for your downstream application to prune the SELECT list further.
    2. Check if project.dataset.events is clustered by user_id to speed up the semi-join.
    3. Review the execution plan in the BigQuery Console to confirm the "Bytes Processed" reduction.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Refactor legacy SQL to use EXISTS instead of costly IN subqueries.Implement table partitioning and clustering to reduce bytes scanned.Swap precise counts for approximate aggregations in large-scale analytics.Prune columns from SELECT * statements to lower GCP billing.

    About this skill

    The problem

    Large BigQuery environments often suffer from spiraling costs due to inefficient full-table scans, redundant subqueries, and poor partitioning. Data teams waste budget on unoptimized SQL that processes terabytes of unnecessary data.

    What it does

    • Refactors expensive subqueries using EXISTS and IN optimizations to improve execution plans.
    • Enforces strict column pruning to eliminate SELECT * and reduce bytes scanned.
    • Converts precise aggregations to approximate functions like APPROX_COUNT_DISTINCT for massive datasets.
    • Designs table partitioning and clustering strategies to leverage predicate pushdown.

    Frameworks & tools

    Google Cloud BigQuery, SQL, Dataform, and ELT pipelines.

    Why this beats prompting it yourself

    Generic LLMs often write valid SQL that is financially disastrous in a BigQuery environment. This skill applies specific BigQuery engine optimizations and cost-reduction patterns that generalized models ignore, focusing specifically on slot-time and byte-scan efficiency.

    Use cases

    • Refactoring legacy SQL scripts to reduce monthly GCP billing.
    • Schema design for new event-logging tables using partitioning and clustering.
    • Optimizing long-running ELT jobs that exceed slot quotas.
    • Improving dashboard performance by migrating to approximate aggregations.

    Known limitations

    Focuses exclusively on BigQuery SQL dialect; not intended for Postgres or Snowflake specific optimizations.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 6 days ago

    • Passed all security checks, Safe to install

    Listed6 days ago

    What's inside

    Frequently Asked Questions