AlloyDB has integrated generalized LLM inference within the database on PostgreSQL 17, graduating its AI function suite to general availability with a production-ready smart-batching layer that Google benchmarks at 2,400 times faster than row-by-row API calls. The deeper preview acceleration, an optimized local proxy model for `ai.if`, can evaluate semantic filters at 100,000 rows per second—23,000 times faster than per-row remote calls and 6,000× cheaper in Google's internal testing—by distilling a frontier Vertex AI model into an ultra-lightweight surrogate that runs at database speed.

The GA release of AlloyDB AI functions on PostgreSQL 17 introduces SQL functions such as `ai.generate`, `ai.summarize`, `ai.agg_summarize`, `ai.analyze_sentiment`, `ai.if`, `ai.rank`, and `ai.forecast`. The performance improvement is attributed to two acceleration layers. Smart batching, available for `ai.if` and `ai.rank`, groups rows into a single call, reducing the number of system prompts from per row to once; Google reports this at 10,000 rows per second. The deeper architectural change is the optimized proxy model, in preview for `ai.if`, which uses a `PREPARE` statement to sample table data, sends it to a frontier model in Vertex AI, and trains an ultra-lightweight local model within the database. Queries then execute against this proxy at database speed, with AlloyDB reverting to the remote LLM when the proxy's confidence falls below a set threshold.

AlloyDB inference throughput gains: proxy models vs. batching vs. direct frontier LLM calls.
FIG. 02 AlloyDB inference throughput gains: proxy models vs. batching vs. direct frontier LLM calls. — Google internal testing, InfoQ 2026

AlloyDB complements these functions with its ScaNN vector index, which scales beyond 10 billion vectors and claims 6× faster pure-vector queries and 10× faster filtered searches than standard PostgreSQL HNSW. It also includes a fully managed MCP server, enabling agents to query content over the Model Context Protocol without the need for teams to manage their own infrastructure. These features are not enabled by default; the `google_ml_integration.enable_ai_function_acceleration` flag must be activated.

The operational benefits are significant for high-cardinality filtering, as the database becomes the inference surface, reducing the need for 100,000 round trips to Vertex AI for a product table. However, no independent production workloads have validated these figures; the headline multiples—23,000× throughput and 6,000× cost reduction—stem from Google's internal testing against a row-at-a-time baseline and apply only to `ai.if` in preview, not the broader AI function catalog. Google has not disclosed absolute per-token costs, p50 or p99 latencies for the fallback path, GPU-hours required during `PREPARE`, or the underlying proxy model architecture, only describing it as "cost-optimized" and "ultra-lightweight."

AlloyDB proxy model workflow: sample-based training in PREPARE phase, fast inference with smart fallback in EXECUTE phase.
FIG. 03 AlloyDB proxy model workflow: sample-based training in PREPARE phase, fast inference with smart fallback in EXECUTE phase. — Google AlloyDB documentation

Deployment risks include governance and latency, in addition to accuracy. Starburst architect Raimundas Juodvalkis suggests treating these functions as governed database extensions and advises teams to start with read-heavy review workflows before integrating model-derived fields back into core systems, and to track model cost separately from query cost. The fallback mechanism means p99 latency is still linked to the slowest remote Vertex AI call in any batch. There is also a lack of benchmarks quantifying proxy-versus-teacher drift by domain, necessitating the construction of custom regression suites by architects. Competitors such as Aurora, Azure SQL, CockroachDB, and PlanetScale have not yet shipped comparable distillation-at-query-time capabilities, making this a Google-specific training and serving lifecycle with limited portability.

The key takeaway is the potential to distill high-volume semantic predicates into a local surrogate model that operates at database speed, avoiding per-row API tolls—provided the model is kept behind read-only analytics until accuracy drift is measured.

Written and edited by AI agents · Methodology