BigQuery Cost Reduction Features

A transparent PostgreSQL-to-BigQuery query merger that fuses a dashboard’s queries into single scans. Every feature is designed around one goal: scan the data once, answer every tile — saving both bytes scanned and slot time.

Capabilities

Built for Production BigQuery Workloads

PG

Full PostgreSQL Wire Protocol

Speaks pgwire natively. Looker, Looker Studio, Metabase, Grafana, Superset, Redash, Tableau, Sigma, Rundown BI, and any other JDBC/ODBC PostgreSQL driver connect without modification. Supports both simple and extended query protocols.

SQL

Automatic SQL Translation

Translates PostgreSQL dialect to BigQuery SQL on the fly. Handles type casts, identifier quoting, function mappings, and catalog queries so your BI tool sees a PostgreSQL database.

TW

Configurable Merge Window

Set the time window (in milliseconds) that QueryFuser waits before flushing a merge group. Short windows for latency-sensitive workloads, longer windows for batch analytics.

TO

Table Overlap Partitioning

Queries are only merged if they share a minimum number of referenced tables. Configurable per project. Prevents unrelated queries from being forced into the same merged query.

FB

Automatic Fallback

If a merged query fails (schema mismatch, column count difference, permission error), QueryFuser automatically re-executes each query individually. Queries that work still succeed; broken ones still report their real error.

MG

Max Group Size

Cap how many queries can be merged into a single query. When the limit is hit, the group is flushed immediately and new queries start a fresh group. Prevents runaway query sizes.

KS

Per-Project Kill Switch

Disable merging for any project with a single toggle. Queries pass through to BigQuery individually. Useful for debugging, compliance requirements, or workloads where merging is not beneficial.

MP

Multi-Project Support

Manage multiple BigQuery projects with separate service accounts, datasets, and merge settings. Each project is fully isolated. Cross-project merging is supported when credentials allow.

ML

Merge Logs and Query Logs

Every merge group and every individual query is logged with duration, bytes processed, error messages, and linkage between merge groups and their constituent queries. Full observability.

ST

Slot Time Tracking

QueryFuser tracks BigQuery slot time (totalSlotMs) for every query and merge group. See exactly how much compute capacity your dashboard consumes, and how much slot time merging saves — on top of the bytes saved.

CO

Cache Optimizer

Replaces NOW(), CURRENT_DATE(), CURRENT_TIMESTAMP(), and other non-deterministic date/time functions with computed literal values. Unlocks BigQuery’s query result cache and boosts merge rates by making identical queries produce identical SQL.

IP

IP Whitelisting

Restrict proxy connections to specific IP addresses or CIDR ranges per project. Supports IPv4 and IPv6. All other connections are rejected at the wire protocol level before any query is executed.

Cache Optimizer

Unlock BigQuery’s Hidden Query Cache

BigQuery automatically caches query results for 24 hours — but only if the SQL text is byte-for-byte identical. Functions like CURRENT_DATE() and NOW() change their value every time they’re evaluated, making every query unique. That one function call in a WHERE clause can be the difference between a free cached result and a full table scan.

Date Filters in WHERE Clauses

Most dashboards filter by “today” or “last 30 days.” Every BI tool generates WHERE date >= CURRENT_DATE() - 30. Because CURRENT_DATE() is non-deterministic, BigQuery treats every execution as a new query — even if it’s the same dashboard loaded by different users seconds apart.

QueryFuser replaces CURRENT_DATE() with today’s literal date (e.g. DATE '2026-03-08') using your configured business timezone. Every user hitting the same dashboard gets the exact same SQL → BigQuery serves it from cache.

-- Before (cache miss every time)
SELECT region, SUM(amount)
FROM sales
WHERE sale_date >= CURRENT_DATE() - 30
GROUP BY 1

-- After (identical SQL = cache hit)
SELECT region, SUM(amount)
FROM sales
WHERE sale_date >= DATE '2026-03-08' - 30
GROUP BY 1

Timestamp Columns in SELECT

Dashboards often include a “last refreshed” timestamp or use CURRENT_TIMESTAMP() in computed columns. Even when the WHERE clause is static, a single NOW() in the SELECT list makes the SQL text different on every execution, so BigQuery treats it as a brand-new query every time.

QueryFuser replaces CURRENT_TIMESTAMP() and NOW() with a literal truncated to a configurable resolution window (default: 5 minutes). All queries within the same window produce identical SQL → they merge into one execution and share cached results.

-- Before (unique SQL every second)
SELECT product, SUM(qty),
       CURRENT_TIMESTAMP() AS refreshed_at
FROM inventory
GROUP BY 1

-- After (same SQL for 5 minutes)
SELECT product, SUM(qty),
       TIMESTAMP '2026-03-08 14:35:00+00' AS refreshed_at
FROM inventory
GROUP BY 1

Double benefit: cache and merge

Without the optimizer, 10 users loading the same 8-tile dashboard at 9:01 AM send 80 queries whose SQL varies with every call to NOW(). With the optimizer, those 80 queries collapse to just 8 deterministic SQL texts — QueryFuser merges the 8 into a single scan, and BigQuery caches the results for up to 24 hours. The first load pays for one scan; every subsequent load within the cache window is free.

All replaced functions

Function Replaced With Timezone-Aware
CURRENT_DATE / CURRENT_DATE()DATE '2026-03-08'Yes
CURRENT_TIMESTAMP / CURRENT_TIMESTAMP()TIMESTAMP '2026-03-08 14:35:00+00'Yes
NOW()TIMESTAMP '2026-03-08 14:35:00+00'Yes
CURRENT_TIME / CURRENT_TIME()TIME '14:35:00'Yes
CURRENT_DATETIME / CURRENT_DATETIME()DATETIME '2026-03-08 14:35:00'Yes

Timestamps are truncated to your configured resolution (1 min to 24 hours). Dates use your configured business timezone so CURRENT_DATE returns the correct date even when the server is in UTC.

Schema Compatibility

Works With Any Schema Pattern

QueryFuser merges based on table overlap, not schema design. Star schemas, snowflake schemas, and flat denormalized tables all benefit.

Schema Pattern Typical Table Size Merge Behavior Typical Savings
Star Schema (INT keys) Large fact table
Dims 100–1,000× smaller
Each tile: amount + 1 join key = 2 units. Merged: amount + 3 keys = 4 units. Dim tables are 100–1,000× smaller — negligible. 75%
4/16 — 8 tiles
Star Schema (STRING keys) Same, keys 4× INT size Each tile: 1 + 4 = 5 units. Merged: 1 + 3×4 = 13 units. Less savings because amount is a smaller share of each tile’s cost. 68%
13/40 — 8 tiles
Single Table (5 string dims) 100 M rows
no joins
Each tile: 1 + 4 = 5 units. Merged: 1 + 5×4 = 21 units. More unique dims in the merge = wider scan = lower savings. 48%
21/40 — 8 tiles

Baseline: 8-tile dashboard, 100 M-row fact table, 3 dim tables. 1 unit = one INT64/FLOAT64 column (800 MB). STRING = 4 units. Dashboards with more tiles or fewer dims save even more. See detailed calculations →

Type System

BigQuery Type Coverage

QueryFuser translates BigQuery types to PostgreSQL wire format for seamless BI tool compatibility. All standard BigQuery types are supported.

BigQuery Type PostgreSQL Wire Type Merge Compatible Notes
STRINGTEXTYesDirect mapping
INT64INT8 (BIGINT)YesDirect mapping
FLOAT64FLOAT8YesDirect mapping
NUMERICNUMERICYesArbitrary precision preserved
BOOLBOOLYesDirect mapping
DATEDATEYesDirect mapping
TIMESTAMPTIMESTAMPTZYesUTC normalized
DATETIMETIMESTAMPYesNo timezone
BYTESBYTEAYesBase64 decoded
JSONJSONBYesPassed as text
ARRAY / STRUCTJSONBYesSerialized to JSON
GEOGRAPHYTEXTYesGeoJSON string

When merging queries with different column counts, QueryFuser automatically normalizes the result sets. Each caller receives exactly the columns they requested.

Architecture

Where QueryFuser Sits

QueryFuser architecture: 8 dashboard queries merged into 1 BigQuery scan

QueryFuser runs as a single binary. No sidecar, no agent, no SDK. Your BI tool connects to it as a PostgreSQL database. QueryFuser handles authentication, SQL translation, query merging, and result delivery.

See It In Action

Set up QueryFuser in under five minutes and watch your BigQuery bill drop.

Get Started