- Home
- Skills
- Data & Databases
- bigquery enterprise optimizer
Works with the AI tools you already use
bigquery enterprise optimizer
Reduce BigQuery costs and execution time through SQL refactoring and partitioning strategies.
$12
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
| Metric | Improvement | Details |
|---|---|---|
| Columns Pruned | High | Replaced SELECT * with 5 specific required columns. |
| Scan Reduction | ~65% | Estimates based on removing metadata and unused high-width columns. |
| Logic Swap | EXISTS | Converted IN subquery to EXISTS to avoid internal materialization. |
| Predicate Pushdown | Enabled | Filtered on event_date assuming standard daily partitioning. |
Next steps
- Verify the specific columns needed for your downstream application to prune the SELECT list further.
- Check if
project.dataset.eventsis clustered byuser_idto speed up the semi-join. - 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
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
EXISTSandINoptimizations to improve execution plans. - Enforces strict column pruning to eliminate
SELECT *and reduce bytes scanned. - Converts precise aggregations to approximate functions like
APPROX_COUNT_DISTINCTfor 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.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 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