Bulut & SaaS · Özgün analiz · TR · EN
Sektör analizi: Supercharging pgvector: 4x faster HNSW vector search with AlloyDB
<div class="block-paragraph_advanced"><p><a href="https://cloud.google.com/alloydb"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB</span></a><span style="vertical-align: baseline;"> is a fully managed, PostgreSQL-compatible database service built for your most demanding enterprise workloads. It combines the best of open source PostgreSQL with Google’s advanced technology, offering massive scalability, high availability, and native AI capabilities. It serves as a performant relational store, a unified backend for vector and full text search, and an analytics engine that is up to 100x faster than standard PostgreSQL. </span></p> <p><span style="vertical-align: baseline;">Vector search is the foundation of modern AI and Retrieval Augmented Generation (RAG) applications. For developers using AlloyDB and other PostgreSQL databases, </span><a href="https://github.com/pgvector/pgvector" rel="noopener" target="_blank"><code style="text-decoration: underline; vertical-align: baseline;">pgvector</code></a><span style="vertical-align: baseline;"> is a widely adopted extension for storing, indexing, and querying vector embeddings, and HNSW (Hierarchical Navigable Small World) is a highly efficient graph-based algorithm designed for approximate nearest neighbor search across multi-layered structures. With </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</span></a><span style="vertical-align: baseline;"> in AlloyDB (now in preview), you can achieve up to 4x higher queries per second (QPS) for vector search compared to standard PostgreSQL HNSW.</span></p> <p><span style="vertical-align: baseline;">Enterprise AI applications face a constant trade-off between speed and accuracy. When searching through millions or billions of vectors, maximizing Queries per Second (QPS) without sacrificing search quality (recall) is critical for scaling production workloads. The PostgreSQL </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> extension offers HNSW as one of the indexes that can speed up Approximate Nearest Neighbor (ANN) searches. Let’s dive deep into how AlloyDB solves the speed vs. accuracy trade-off. </span></p> <p><span style="vertical-align: baseline;">Note: While this post focuses on HNSW performance, it’s worth noting that HNSW is just one part of AlloyDB’s advanced vector toolkit. AlloyDB also features </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/create-scann-index"><span style="text-decoration: underline; vertical-align: baseline;">ScaNN</span></a><span style="vertical-align: baseline;">—a cutting-edge index backed by over 14 years of Google Research—giving you the flexibility to choose the perfect index for your workload. Additionally, for use cases demanding absolute precision, standard k-nearest neighbor (KNN) search is always available for 100% recall. Check out our </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a Vector Index Guide</span></a><span style="vertical-align: baseline;"> to see how they stack up.</span></p></div> <div class="block-aside"><dl> <dt>aside_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;title&#x27;, &#x27;Get started with a 30-day AlloyDB free trial instance&#x27;), (&#x27;body&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f019660e400&gt;), (&#x27;btn_text&#x27;, &#x27;Start building for free&#x27;), (&#x27;href&#x27;, &#x27;http://goo.gle/try_alloydb&#x27;), (&#x27;image&#x27;, None)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><h3><strong style="vertical-align: baseline;">First, what is the AlloyDB columnar engine? </strong></h3> <p><span style="vertical-align: baseline;">The </span><a href="https://docs.cloud.google.com/alloydb/docs/columnar-engine/about"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB columnar engine</span></a><span style="vertical-align: baseline;"> is a built-in, in-memory cache that automatically stores frequently queried data in a specialized, scan-optimized columnar format. It allows AlloyDB to handle heavy analytical queries up to 100x faster than standard PostgreSQL. Additionally, it accelerates ANN searches by storing the index in memory, using a vectorized memory layout for fast traversals, and bypassing standard PostgreSQL buffer manager overhead. </span></p> <h3><strong style="vertical-align: baseline;">Performance visualization</strong></h3> <p><span style="vertical-align: baseline;">To understand the real-world performance characteristics of columnar engine Accelerated HNSW, we plotted standard QPS vs Recall curves for the GloVe 100 Angular dataset by searching more than 1M records with a limit of 100.</span></p> <p><span style="vertical-align: baseline;">Running this </span><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">benchmark script</span></a><span style="vertical-align: baseline;"> yields the following visualization:</span></p></div> <div class="block-image_full_width"> <div class="article-module h-c-page"> <div class="h-c-grid"> <figure class="article-image--large h-c-grid__col h-c-grid__col--6 h-c-grid__col--offset-3 " > <img src="https://storage.googleapis.com/gweb-cloudblog-publish/images/1_r57mjyN.max-1000x1000.png" alt="1"> </a> <figcaption class="article-image__caption "><p data-block-key="xai0q">Note: These measurements were taken on an AlloyDB C4A 16vCPU machine. Due to the inherent randomness in HNSW graph building, results may slightly vary across runs.</p></figcaption> </figure> </div> </div> </div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">The data reveals two transformative benefits:</span></p> <ol> <li role="presentation"><strong style="vertical-align: baseline;">Massive performance throughput gains: </strong><span style="vertical-align: baseline;">For any given target recall (e.g. 0.95), QPS is increased by approximately </span><strong style="vertical-align: baseline;">4.2x to 4.9x</strong><span style="vertical-align: baseline;">. This allows you to handle significantly more concurrent vector searches on the same hardware.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Significant recall (accuracy) improvement: </strong><span style="vertical-align: baseline;">Conversely, at a fixed QPS level, columnar engine accelerated HNSW provides a substantial boost in recall. For example, we saw that at ~350 QPS (in the above chart), enabling the columnar engine improves recall from roughly </span><strong style="vertical-align: baseline;">0.78 to over 0.94 </strong><span style="vertical-align: baseline;">– a </span><strong style="vertical-align: baseline;">0.163 recall gain</strong><span style="vertical-align: baseline;">. This means your AI applications get much more accurate results without any latency impact.</span></li> </ol> <p><span style="vertical-align: baseline;">It is important to note that the baseline (blue line) already represents the index being fully cached in the PostgreSQL shared buffer cache. The performance gains shown here are not the result of moving data from disk to RAM, but rather the result of a more efficient memory architecture.</span></p> <h3><strong style="vertical-align: baseline;">How it works: Columnar engine Accelerated HNSW</strong></h3> <p><span style="vertical-align: baseline;">In standard PostgreSQL architectures, index operations utilize the shared buffer cache. Even when data is fully in-memory, the database still incurs significant overhead from the buffer manager, which must handle operations such as page pinning and unpinning, lock acquisition, buffer table lookups, and Least Recently Used (LRU) management.</span></p> <p><span style="vertical-align: baseline;">AlloyDB's </span><strong style="vertical-align: baseline;">columnar engine </strong><span style="vertical-align: baseline;">is a built-in, in-memory cache that stores data in a specialized, scan-optimized format.</span></p> <p><span style="vertical-align: baseline;">With this release, AlloyDB can use </span><strong style="vertical-align: baseline;">columnar engine accelerated HNSW </strong><span style="vertical-align: baseline;">to:</span></p> <ul> <li role="presentation"><strong style="vertical-align: baseline;">Pin the index: </strong><span style="vertical-align: baseline;">The </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> HNSW index is pinned (kept persistently in-memory to ensure fast access) directly into the columnar engine’s memory.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Vectorized access: </strong><span style="vertical-align: baseline;">It utilizes a memory layout specifically designed for the high-concurrency, pointer-heavy traversals required by HNSW graphs.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Bypass buffer overhead: </strong><span style="vertical-align: baseline;">By navigating the graph in a specialized memory space, AlloyDB avoids the standard buffer manager bottlenecks. This architectural shift is what enables the dramatic QPS and recall improvements shown above, even when comparing against a fully-cached standard index.</span></li> </ul> <h3><strong style="vertical-align: baseline;">Why it Matters</strong></h3> <p><span style="vertical-align: baseline;">For enterprise-scale applications, this isn't just about a faster database—it's about cost and quality:</span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Reduced infrastructure costs:</strong><span style="vertical-align: baseline;"> Achieve the same performance with significantly lower compute resources.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Better AI accuracy:</strong><span style="vertical-align: baseline;"> Reach higher recall and quality at speeds that were previously only possible for "draft" (high-speed, lower-accuracy results) quality search.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">No application changes required:</strong><span style="vertical-align: baseline;"> Because this is built into AlloyDB, you get these gains using the same standard </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> SQL syntax.</span></p> </li> </ul> <p><span style="vertical-align: baseline;">Note that the columnar engine does utilize memory, but it is highly compressed and meticulously managed. Because the engine stores vector data in an efficient columnar format, the memory footprint is minimal compared to the massive performance gains—making it a highly favorable trade-off for enterprise workloads.</span></p> <h3><strong style="vertical-align: baseline;">Quick Start Guide</strong></h3> <p><span style="vertical-align: baseline;">To try out </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><strong style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</strong></a><span style="vertical-align: baseline;"> in AlloyDB, follow these steps:</span></p> <p><span style="vertical-align: baseline;">1. </span><strong><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">Enable the columnar engine</span></a><span style="vertical-align: baseline;"> and index caching</span></strong></p> <p><span style="vertical-align: baseline;">Ensure that both </span><code style="vertical-align: baseline;">google_columnar_engine.enabled</code><span style="vertical-align: baseline;"> and </span><code style="vertical-align: baseline;">google_columnar_engine.enable_index_caching</code><span style="vertical-align: baseline;"> flags are set to </span><code style="vertical-align: baseline;">on</code><span style="vertical-align: baseline;"> for your AlloyDB instance.</span></p> <p><span style="vertical-align: baseline;">2. <strong>Add the HNSW Index to columnar engine</strong></span></p> <p><span style="vertical-align: baseline;">Once your HNSW index is created via </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;">, execute the following SQL command to cache it in the columnar engine:</span></p></div> <div class="block-code"><dl> <dt>code_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;code&#x27;, &quot;SELECT google_columnar_engine_add_index(&#x27;&lt;hnsw_index_name&gt;&#x27;);&quot;), (&#x27;language&#x27;, &#x27;&#x27;), (&#x27;caption&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f0196625d90&gt;)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">3. <strong>Additional Resources</strong></span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">New to AlloyDB? Discover AlloyDB with a </span><a href="https://docs.cloud.google.com/alloydb/docs/free-trial-cluster"><span style="text-decoration: underline; vertical-align: baseline;">30-day free trial</span></a><span style="vertical-align: baseline;">.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">Google Colab Notebook</span></a><span style="vertical-align: baseline;">: An end-to-end Python script to ingest the GloVe dataset, create indexes, and plot Recall vs QPS curves.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">Is HNSW the right vector index choice for your use case? Check our ‘</span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a vector index in AlloyDB AI</span></a><span style="vertical-align: baseline;">’ guide.</span></p> </li> </ul></div> Maestro News, gelişmeyi Maestro Dev ekseninde — yazılım, yapay zekâ, bulut ve ürün teslimatı — özgün dilde yeniden çerçeveliyor.
AEO özet yanıt
Özetle: <div class="block-paragraph_advanced"><p><a href="https://cloud.google.com/alloydb"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB</span></a><span style="vertical-align: baseline;"> is a fully managed, PostgreSQL-compatible database service built for your most demanding enterprise workloads. It combines the best of open source PostgreSQL with Google’s advanced technology, offering massive scalability, high availability, and native AI capabilities. It serves as a performant relational store, a unified backend for vector and full text search, and an analytics engine that is up to 100x faster than standard PostgreSQL. </span></p> <p><span style="vertical-align: baseline;">Vector search is the foundation of modern AI and Retrieval Augmented Generation (RAG) applications. For developers using AlloyDB and other PostgreSQL databases, </span><a href="https://github.com/pgvector/pgvector" rel="noopener" target="_blank"><code style="text-decoration: underline; vertical-align: baseline;">pgvector</code></a><span style="vertical-align: baseline;"> is a widely adopted extension for storing, indexing, and querying vector embeddings, and HNSW (Hierarchical Navigable Small World) is a highly efficient graph-based algorithm designed for approximate nearest neighbor search across multi-layered structures. With </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</span></a><span style="vertical-align: baseline;"> in AlloyDB (now in preview), you can achieve up to 4x higher queries per second (QPS) for vector search compared to standard PostgreSQL HNSW.</span></p> <p><span style="vertical-align: baseline;">Enterprise AI applications face a constant trade-off between speed and accuracy. When searching through millions or billions of vectors, maximizing Queries per Second (QPS) without sacrificing search quality (recall) is critical for scaling production workloads. The PostgreSQL </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> extension offers HNSW as one of the indexes that can speed up Approximate Nearest Neighbor (ANN) searches. Let’s dive deep into how AlloyDB solves the speed vs. accuracy trade-off. </span></p> <p><span style="vertical-align: baseline;">Note: While this post focuses on HNSW performance, it’s worth noting that HNSW is just one part of AlloyDB’s advanced vector toolkit. AlloyDB also features </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/create-scann-index"><span style="text-decoration: underline; vertical-align: baseline;">ScaNN</span></a><span style="vertical-align: baseline;">—a cutting-edge index backed by over 14 years of Google Research—giving you the flexibility to choose the perfect index for your workload. Additionally, for use cases demanding absolute precision, standard k-nearest neighbor (KNN) search is always available for 100% recall. Check out our </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a Vector Index Guide</span></a><span style="vertical-align: baseline;"> to see how they stack up.</span></p></div> <div class="block-aside"><dl> <dt>aside_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;title&#x27;, &#x27;Get started with a 30-day AlloyDB free trial instance&#x27;), (&#x27;body&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f019660e400&gt;), (&#x27;btn_text&#x27;, &#x27;Start building for free&#x27;), (&#x27;href&#x27;, &#x27;http://goo.gle/try_alloydb&#x27;), (&#x27;image&#x27;, None)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><h3><strong style="vertical-align: baseline;">First, what is the AlloyDB columnar engine? </strong></h3> <p><span style="vertical-align: baseline;">The </span><a href="https://docs.cloud.google.com/alloydb/docs/columnar-engine/about"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB columnar engine</span></a><span style="vertical-align: baseline;"> is a built-in, in-memory cache that automatically stores frequently queried data in a specialized, scan-optimized columnar format. It allows AlloyDB to handle heavy analytical queries up to 100x faster than standard PostgreSQL. Additionally, it accelerates ANN searches by storing the index in memory, using a vectorized memory layout for fast traversals, and bypassing standard PostgreSQL buffer manager overhead. </span></p> <h3><strong style="vertical-align: baseline;">Performance visualization</strong></h3> <p><span style="vertical-align: baseline;">To understand the real-world performance characteristics of columnar engine Accelerated HNSW, we plotted standard QPS vs Recall curves for the GloVe 100 Angular dataset by searching more than 1M records with a limit of 100.</span></p> <p><span style="vertical-align: baseline;">Running this </span><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">benchmark script</span></a><span style="vertical-align: baseline;"> yields the following visualization:</span></p></div> <div class="block-image_full_width"> <div class="article-module h-c-page"> <div class="h-c-grid"> <figure class="article-image--large h-c-grid__col h-c-grid__col--6 h-c-grid__col--offset-3 " > <img src="https://storage.googleapis.com/gweb-cloudblog-publish/images/1_r57mjyN.max-1000x1000.png" alt="1"> </a> <figcaption class="article-image__caption "><p data-block-key="xai0q">Note: These measurements were taken on an AlloyDB C4A 16vCPU machine. Due to the inherent randomness in HNSW graph building, results may slightly vary across runs.</p></figcaption> </figure> </div> </div> </div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">The data reveals two transformative benefits:</span></p> <ol> <li role="presentation"><strong style="vertical-align: baseline;">Massive performance throughput gains: </strong><span style="vertical-align: baseline;">For any given target recall (e.g. 0.95), QPS is increased by approximately </span><strong style="vertical-align: baseline;">4.2x to 4.9x</strong><span style="vertical-align: baseline;">. This allows you to handle significantly more concurrent vector searches on the same hardware.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Significant recall (accuracy) improvement: </strong><span style="vertical-align: baseline;">Conversely, at a fixed QPS level, columnar engine accelerated HNSW provides a substantial boost in recall. For example, we saw that at ~350 QPS (in the above chart), enabling the columnar engine improves recall from roughly </span><strong style="vertical-align: baseline;">0.78 to over 0.94 </strong><span style="vertical-align: baseline;">– a </span><strong style="vertical-align: baseline;">0.163 recall gain</strong><span style="vertical-align: baseline;">. This means your AI applications get much more accurate results without any latency impact.</span></li> </ol> <p><span style="vertical-align: baseline;">It is important to note that the baseline (blue line) already represents the index being fully cached in the PostgreSQL shared buffer cache. The performance gains shown here are not the result of moving data from disk to RAM, but rather the result of a more efficient memory architecture.</span></p> <h3><strong style="vertical-align: baseline;">How it works: Columnar engine Accelerated HNSW</strong></h3> <p><span style="vertical-align: baseline;">In standard PostgreSQL architectures, index operations utilize the shared buffer cache. Even when data is fully in-memory, the database still incurs significant overhead from the buffer manager, which must handle operations such as page pinning and unpinning, lock acquisition, buffer table lookups, and Least Recently Used (LRU) management.</span></p> <p><span style="vertical-align: baseline;">AlloyDB's </span><strong style="vertical-align: baseline;">columnar engine </strong><span style="vertical-align: baseline;">is a built-in, in-memory cache that stores data in a specialized, scan-optimized format.</span></p> <p><span style="vertical-align: baseline;">With this release, AlloyDB can use </span><strong style="vertical-align: baseline;">columnar engine accelerated HNSW </strong><span style="vertical-align: baseline;">to:</span></p> <ul> <li role="presentation"><strong style="vertical-align: baseline;">Pin the index: </strong><span style="vertical-align: baseline;">The </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> HNSW index is pinned (kept persistently in-memory to ensure fast access) directly into the columnar engine’s memory.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Vectorized access: </strong><span style="vertical-align: baseline;">It utilizes a memory layout specifically designed for the high-concurrency, pointer-heavy traversals required by HNSW graphs.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Bypass buffer overhead: </strong><span style="vertical-align: baseline;">By navigating the graph in a specialized memory space, AlloyDB avoids the standard buffer manager bottlenecks. This architectural shift is what enables the dramatic QPS and recall improvements shown above, even when comparing against a fully-cached standard index.</span></li> </ul> <h3><strong style="vertical-align: baseline;">Why it Matters</strong></h3> <p><span style="vertical-align: baseline;">For enterprise-scale applications, this isn't just about a faster database—it's about cost and quality:</span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Reduced infrastructure costs:</strong><span style="vertical-align: baseline;"> Achieve the same performance with significantly lower compute resources.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Better AI accuracy:</strong><span style="vertical-align: baseline;"> Reach higher recall and quality at speeds that were previously only possible for "draft" (high-speed, lower-accuracy results) quality search.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">No application changes required:</strong><span style="vertical-align: baseline;"> Because this is built into AlloyDB, you get these gains using the same standard </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> SQL syntax.</span></p> </li> </ul> <p><span style="vertical-align: baseline;">Note that the columnar engine does utilize memory, but it is highly compressed and meticulously managed. Because the engine stores vector data in an efficient columnar format, the memory footprint is minimal compared to the massive performance gains—making it a highly favorable trade-off for enterprise workloads.</span></p> <h3><strong style="vertical-align: baseline;">Quick Start Guide</strong></h3> <p><span style="vertical-align: baseline;">To try out </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><strong style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</strong></a><span style="vertical-align: baseline;"> in AlloyDB, follow these steps:</span></p> <p><span style="vertical-align: baseline;">1. </span><strong><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">Enable the columnar engine</span></a><span style="vertical-align: baseline;"> and index caching</span></strong></p> <p><span style="vertical-align: baseline;">Ensure that both </span><code style="vertical-align: baseline;">google_columnar_engine.enabled</code><span style="vertical-align: baseline;"> and </span><code style="vertical-align: baseline;">google_columnar_engine.enable_index_caching</code><span style="vertical-align: baseline;"> flags are set to </span><code style="vertical-align: baseline;">on</code><span style="vertical-align: baseline;"> for your AlloyDB instance.</span></p> <p><span style="vertical-align: baseline;">2. <strong>Add the HNSW Index to columnar engine</strong></span></p> <p><span style="vertical-align: baseline;">Once your HNSW index is created via </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;">, execute the following SQL command to cache it in the columnar engine:</span></p></div> <div class="block-code"><dl> <dt>code_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;code&#x27;, &quot;SELECT google_columnar_engine_add_index(&#x27;&lt;hnsw_index_name&gt;&#x27;);&quot;), (&#x27;language&#x27;, &#x27;&#x27;), (&#x27;caption&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f0196625d90&gt;)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">3. <strong>Additional Resources</strong></span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">New to AlloyDB? Discover AlloyDB with a </span><a href="https://docs.cloud.google.com/alloydb/docs/free-trial-cluster"><span style="text-decoration: underline; vertical-align: baseline;">30-day free trial</span></a><span style="vertical-align: baseline;">.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">Google Colab Notebook</span></a><span style="vertical-align: baseline;">: An end-to-end Python script to ingest the GloVe dataset, create indexes, and plot Recall vs QPS curves.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">Is HNSW the right vector index choice for your use case? Check our ‘</span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a vector index in AlloyDB AI</span></a><span style="vertical-align: baseline;">’ guide.</span></p> </li> </ul></div> Maestro News, gelişmeyi Maestro Dev ekseninde — yazılım, yapay zekâ, bulut ve ürün teslimatı — özgün dilde yeniden çerçeveliyor.
Öne çıkan çıkarımlar
- Gelişme yazılım ve AI yol haritalarında öncelikleri etkileyebilir.
- Ürün, mühendislik ve bulut teslimatı birlikte okunmalı.
- Karar öncesi birincil kaynak ve dokümantasyon doğrulanmalı.
Ne oldu?
<div class="block-paragraph_advanced"><p><a href="https://cloud.google.com/alloydb"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB</span></a><span style="vertical-align: baseline;"> is a fully managed, PostgreSQL-compatible database service built for your most demanding enterprise workloads. It combines the best of open source PostgreSQL with Google’s advanced technology, offering massive scalability, high availability, and native AI capabilities. It serves as a performant relational store, a unified backend for vector and full text search, and an analytics engine that is up to 100x faster than standard PostgreSQL. </span></p> <p><span style="vertical-align: baseline;">Vector search is the foundation of modern AI and Retrieval Augmented Generation (RAG) applications. For developers using AlloyDB and other PostgreSQL databases, </span><a href="https://github.com/pgvector/pgvector" rel="noopener" target="_blank"><code style="text-decoration: underline; vertical-align: baseline;">pgvector</code></a><span style="vertical-align: baseline;"> is a widely adopted extension for storing, indexing, and querying vector embeddings, and HNSW (Hierarchical Navigable Small World) is a highly efficient graph-based algorithm designed for approximate nearest neighbor search across multi-layered structures. With </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</span></a><span style="vertical-align: baseline;"> in AlloyDB (now in preview), you can achieve up to 4x higher queries per second (QPS) for vector search compared to standard PostgreSQL HNSW.</span></p> <p><span style="vertical-align: baseline;">Enterprise AI applications face a constant trade-off between speed and accuracy. When searching through millions or billions of vectors, maximizing Queries per Second (QPS) without sacrificing search quality (recall) is critical for scaling production workloads. The PostgreSQL </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> extension offers HNSW as one of the indexes that can speed up Approximate Nearest Neighbor (ANN) searches. Let’s dive deep into how AlloyDB solves the speed vs. accuracy trade-off. </span></p> <p><span style="vertical-align: baseline;">Note: While this post focuses on HNSW performance, it’s worth noting that HNSW is just one part of AlloyDB’s advanced vector toolkit. AlloyDB also features </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/create-scann-index"><span style="text-decoration: underline; vertical-align: baseline;">ScaNN</span></a><span style="vertical-align: baseline;">—a cutting-edge index backed by over 14 years of Google Research—giving you the flexibility to choose the perfect index for your workload. Additionally, for use cases demanding absolute precision, standard k-nearest neighbor (KNN) search is always available for 100% recall. Check out our </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a Vector Index Guide</span></a><span style="vertical-align: baseline;"> to see how they stack up.</span></p></div> <div class="block-aside"><dl> <dt>aside_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;title&#x27;, &#x27;Get started with a 30-day AlloyDB free trial instance&#x27;), (&#x27;body&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f019660e400&gt;), (&#x27;btn_text&#x27;, &#x27;Start building for free&#x27;), (&#x27;href&#x27;, &#x27;http://goo.gle/try_alloydb&#x27;), (&#x27;image&#x27;, None)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><h3><strong style="vertical-align: baseline;">First, what is the AlloyDB columnar engine? </strong></h3> <p><span style="vertical-align: baseline;">The </span><a href="https://docs.cloud.google.com/alloydb/docs/columnar-engine/about"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB columnar engine</span></a><span style="vertical-align: baseline;"> is a built-in, in-memory cache that automatically stores frequently queried data in a specialized, scan-optimized columnar format. It allows AlloyDB to handle heavy analytical queries up to 100x faster than standard PostgreSQL. Additionally, it accelerates ANN searches by storing the index in memory, using a vectorized memory layout for fast traversals, and bypassing standard PostgreSQL buffer manager overhead. </span></p> <h3><strong style="vertical-align: baseline;">Performance visualization</strong></h3> <p><span style="vertical-align: baseline;">To understand the real-world performance characteristics of columnar engine Accelerated HNSW, we plotted standard QPS vs Recall curves for the GloVe 100 Angular dataset by searching more than 1M records with a limit of 100.</span></p> <p><span style="vertical-align: baseline;">Running this </span><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">benchmark script</span></a><span style="vertical-align: baseline;"> yields the following visualization:</span></p></div> <div class="block-image_full_width"> <div class="article-module h-c-page"> <div class="h-c-grid"> <figure class="article-image--large h-c-grid__col h-c-grid__col--6 h-c-grid__col--offset-3 " > <img src="https://storage.googleapis.com/gweb-cloudblog-publish/images/1_r57mjyN.max-1000x1000.png" alt="1"> </a> <figcaption class="article-image__caption "><p data-block-key="xai0q">Note: These measurements were taken on an AlloyDB C4A 16vCPU machine. Due to the inherent randomness in HNSW graph building, results may slightly vary across runs.</p></figcaption> </figure> </div> </div> </div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">The data reveals two transformative benefits:</span></p> <ol> <li role="presentation"><strong style="vertical-align: baseline;">Massive performance throughput gains: </strong><span style="vertical-align: baseline;">For any given target recall (e.g. 0.95), QPS is increased by approximately </span><strong style="vertical-align: baseline;">4.2x to 4.9x</strong><span style="vertical-align: baseline;">. This allows you to handle significantly more concurrent vector searches on the same hardware.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Significant recall (accuracy) improvement: </strong><span style="vertical-align: baseline;">Conversely, at a fixed QPS level, columnar engine accelerated HNSW provides a substantial boost in recall. For example, we saw that at ~350 QPS (in the above chart), enabling the columnar engine improves recall from roughly </span><strong style="vertical-align: baseline;">0.78 to over 0.94 </strong><span style="vertical-align: baseline;">– a </span><strong style="vertical-align: baseline;">0.163 recall gain</strong><span style="vertical-align: baseline;">. This means your AI applications get much more accurate results without any latency impact.</span></li> </ol> <p><span style="vertical-align: baseline;">It is important to note that the baseline (blue line) already represents the index being fully cached in the PostgreSQL shared buffer cache. The performance gains shown here are not the result of moving data from disk to RAM, but rather the result of a more efficient memory architecture.</span></p> <h3><strong style="vertical-align: baseline;">How it works: Columnar engine Accelerated HNSW</strong></h3> <p><span style="vertical-align: baseline;">In standard PostgreSQL architectures, index operations utilize the shared buffer cache. Even when data is fully in-memory, the database still incurs significant overhead from the buffer manager, which must handle operations such as page pinning and unpinning, lock acquisition, buffer table lookups, and Least Recently Used (LRU) management.</span></p> <p><span style="vertical-align: baseline;">AlloyDB's </span><strong style="vertical-align: baseline;">columnar engine </strong><span style="vertical-align: baseline;">is a built-in, in-memory cache that stores data in a specialized, scan-optimized format.</span></p> <p><span style="vertical-align: baseline;">With this release, AlloyDB can use </span><strong style="vertical-align: baseline;">columnar engine accelerated HNSW </strong><span style="vertical-align: baseline;">to:</span></p> <ul> <li role="presentation"><strong style="vertical-align: baseline;">Pin the index: </strong><span style="vertical-align: baseline;">The </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> HNSW index is pinned (kept persistently in-memory to ensure fast access) directly into the columnar engine’s memory.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Vectorized access: </strong><span style="vertical-align: baseline;">It utilizes a memory layout specifically designed for the high-concurrency, pointer-heavy traversals required by HNSW graphs.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Bypass buffer overhead: </strong><span style="vertical-align: baseline;">By navigating the graph in a specialized memory space, AlloyDB avoids the standard buffer manager bottlenecks. This architectural shift is what enables the dramatic QPS and recall improvements shown above, even when comparing against a fully-cached standard index.</span></li> </ul> <h3><strong style="vertical-align: baseline;">Why it Matters</strong></h3> <p><span style="vertical-align: baseline;">For enterprise-scale applications, this isn't just about a faster database—it's about cost and quality:</span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Reduced infrastructure costs:</strong><span style="vertical-align: baseline;"> Achieve the same performance with significantly lower compute resources.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Better AI accuracy:</strong><span style="vertical-align: baseline;"> Reach higher recall and quality at speeds that were previously only possible for "draft" (high-speed, lower-accuracy results) quality search.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">No application changes required:</strong><span style="vertical-align: baseline;"> Because this is built into AlloyDB, you get these gains using the same standard </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> SQL syntax.</span></p> </li> </ul> <p><span style="vertical-align: baseline;">Note that the columnar engine does utilize memory, but it is highly compressed and meticulously managed. Because the engine stores vector data in an efficient columnar format, the memory footprint is minimal compared to the massive performance gains—making it a highly favorable trade-off for enterprise workloads.</span></p> <h3><strong style="vertical-align: baseline;">Quick Start Guide</strong></h3> <p><span style="vertical-align: baseline;">To try out </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><strong style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</strong></a><span style="vertical-align: baseline;"> in AlloyDB, follow these steps:</span></p> <p><span style="vertical-align: baseline;">1. </span><strong><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">Enable the columnar engine</span></a><span style="vertical-align: baseline;"> and index caching</span></strong></p> <p><span style="vertical-align: baseline;">Ensure that both </span><code style="vertical-align: baseline;">google_columnar_engine.enabled</code><span style="vertical-align: baseline;"> and </span><code style="vertical-align: baseline;">google_columnar_engine.enable_index_caching</code><span style="vertical-align: baseline;"> flags are set to </span><code style="vertical-align: baseline;">on</code><span style="vertical-align: baseline;"> for your AlloyDB instance.</span></p> <p><span style="vertical-align: baseline;">2. <strong>Add the HNSW Index to columnar engine</strong></span></p> <p><span style="vertical-align: baseline;">Once your HNSW index is created via </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;">, execute the following SQL command to cache it in the columnar engine:</span></p></div> <div class="block-code"><dl> <dt>code_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;code&#x27;, &quot;SELECT google_columnar_engine_add_index(&#x27;&lt;hnsw_index_name&gt;&#x27;);&quot;), (&#x27;language&#x27;, &#x27;&#x27;), (&#x27;caption&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f0196625d90&gt;)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">3. <strong>Additional Resources</strong></span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">New to AlloyDB? Discover AlloyDB with a </span><a href="https://docs.cloud.google.com/alloydb/docs/free-trial-cluster"><span style="text-decoration: underline; vertical-align: baseline;">30-day free trial</span></a><span style="vertical-align: baseline;">.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">Google Colab Notebook</span></a><span style="vertical-align: baseline;">: An end-to-end Python script to ingest the GloVe dataset, create indexes, and plot Recall vs QPS curves.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">Is HNSW the right vector index choice for your use case? Check our ‘</span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a vector index in AlloyDB AI</span></a><span style="vertical-align: baseline;">’ guide.</span></p> </li> </ul></div> Maestro News, gelişmeyi Maestro Dev ekseninde — yazılım, yapay zekâ, bulut ve ürün teslimatı — özgün dilde yeniden çerçeveliyor.
Neden önemli?
Bu gelişme; özel yazılım, SaaS ve yapay zekâ ekiplerinin mimari, bütçe ve go-to-market kararlarını etkileyebilir.
Maestro Dev perspektifi
Kurumsal yazılım, AI ajanları, RAG ve bulut altyapısı kesişimleri öne çıkarılıyor.
Sonraki adımlar
Dokümantasyon, API ve referans mimariler izlenerek güncelleme sürdürülecek.
Kaynak ve alıntı
“<div class="block-paragraph_advanced"><p><a href="https://cloud.google.com/alloydb"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB</span></a><span style="vertical-align: baseline;"> is a fully managed, Postgre”
— Google Cloud Blog: Supercharging pgvector: 4x faster HNSW vector search with AlloyDB
Haber alıntı bölümü
Kaynak ve atıf
“<div class="block-paragraph_advanced"><p><a href="https://cloud.google.com/alloydb"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB</span></a><span style="vertical-align: baseline;"> is a fully managed, Postgre”
- Kaynak
- Google Cloud Blog
- Orijinal başlık
- Supercharging pgvector: 4x faster HNSW vector search with AlloyDB
Alıntı yalnızca bağlam ve atıf amaçlıdır. Analiz metni Maestro News’e aittir; orijinal haberin telifi kaynak yayıncıya aittir.
Sık sorulanlar
Yazılım ekipleri için neden önemli?
<div class="block-paragraph_advanced"><p><a href="https://cloud.google.com/alloydb"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB</span></a><span style="vertical-align: baseline;"> is a fully managed, PostgreSQL-compatible database service built for your most demanding enterprise workloads. It combines the best of open source PostgreSQL with Google’s advanced technology, offering massive scalability, high availability, and native AI capabilities. It serves as a performant relational store, a unified backend for vector and full text search, and an analytics engine that is up to 100x faster than standard PostgreSQL. </span></p> <p><span style="vertical-align: baseline;">Vector search is the foundation of modern AI and Retrieval Augmented Generation (RAG) applications. For developers using AlloyDB and other PostgreSQL databases, </span><a href="https://github.com/pgvector/pgvector" rel="noopener" target="_blank"><code style="text-decoration: underline; vertical-align: baseline;">pgvector</code></a><span style="vertical-align: baseline;"> is a widely adopted extension for storing, indexing, and querying vector embeddings, and HNSW (Hierarchical Navigable Small World) is a highly efficient graph-based algorithm designed for approximate nearest neighbor search across multi-layered structures. With </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</span></a><span style="vertical-align: baseline;"> in AlloyDB (now in preview), you can achieve up to 4x higher queries per second (QPS) for vector search compared to standard PostgreSQL HNSW.</span></p> <p><span style="vertical-align: baseline;">Enterprise AI applications face a constant trade-off between speed and accuracy. When searching through millions or billions of vectors, maximizing Queries per Second (QPS) without sacrificing search quality (recall) is critical for scaling production workloads. The PostgreSQL </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> extension offers HNSW as one of the indexes that can speed up Approximate Nearest Neighbor (ANN) searches. Let’s dive deep into how AlloyDB solves the speed vs. accuracy trade-off. </span></p> <p><span style="vertical-align: baseline;">Note: While this post focuses on HNSW performance, it’s worth noting that HNSW is just one part of AlloyDB’s advanced vector toolkit. AlloyDB also features </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/create-scann-index"><span style="text-decoration: underline; vertical-align: baseline;">ScaNN</span></a><span style="vertical-align: baseline;">—a cutting-edge index backed by over 14 years of Google Research—giving you the flexibility to choose the perfect index for your workload. Additionally, for use cases demanding absolute precision, standard k-nearest neighbor (KNN) search is always available for 100% recall. Check out our </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a Vector Index Guide</span></a><span style="vertical-align: baseline;"> to see how they stack up.</span></p></div> <div class="block-aside"><dl> <dt>aside_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;title&#x27;, &#x27;Get started with a 30-day AlloyDB free trial instance&#x27;), (&#x27;body&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f019660e400&gt;), (&#x27;btn_text&#x27;, &#x27;Start building for free&#x27;), (&#x27;href&#x27;, &#x27;http://goo.gle/try_alloydb&#x27;), (&#x27;image&#x27;, None)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><h3><strong style="vertical-align: baseline;">First, what is the AlloyDB columnar engine? </strong></h3> <p><span style="vertical-align: baseline;">The </span><a href="https://docs.cloud.google.com/alloydb/docs/columnar-engine/about"><span style="text-decoration: underline; vertical-align: baseline;">AlloyDB columnar engine</span></a><span style="vertical-align: baseline;"> is a built-in, in-memory cache that automatically stores frequently queried data in a specialized, scan-optimized columnar format. It allows AlloyDB to handle heavy analytical queries up to 100x faster than standard PostgreSQL. Additionally, it accelerates ANN searches by storing the index in memory, using a vectorized memory layout for fast traversals, and bypassing standard PostgreSQL buffer manager overhead. </span></p> <h3><strong style="vertical-align: baseline;">Performance visualization</strong></h3> <p><span style="vertical-align: baseline;">To understand the real-world performance characteristics of columnar engine Accelerated HNSW, we plotted standard QPS vs Recall curves for the GloVe 100 Angular dataset by searching more than 1M records with a limit of 100.</span></p> <p><span style="vertical-align: baseline;">Running this </span><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">benchmark script</span></a><span style="vertical-align: baseline;"> yields the following visualization:</span></p></div> <div class="block-image_full_width"> <div class="article-module h-c-page"> <div class="h-c-grid"> <figure class="article-image--large h-c-grid__col h-c-grid__col--6 h-c-grid__col--offset-3 " > <img src="https://storage.googleapis.com/gweb-cloudblog-publish/images/1_r57mjyN.max-1000x1000.png" alt="1"> </a> <figcaption class="article-image__caption "><p data-block-key="xai0q">Note: These measurements were taken on an AlloyDB C4A 16vCPU machine. Due to the inherent randomness in HNSW graph building, results may slightly vary across runs.</p></figcaption> </figure> </div> </div> </div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">The data reveals two transformative benefits:</span></p> <ol> <li role="presentation"><strong style="vertical-align: baseline;">Massive performance throughput gains: </strong><span style="vertical-align: baseline;">For any given target recall (e.g. 0.95), QPS is increased by approximately </span><strong style="vertical-align: baseline;">4.2x to 4.9x</strong><span style="vertical-align: baseline;">. This allows you to handle significantly more concurrent vector searches on the same hardware.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Significant recall (accuracy) improvement: </strong><span style="vertical-align: baseline;">Conversely, at a fixed QPS level, columnar engine accelerated HNSW provides a substantial boost in recall. For example, we saw that at ~350 QPS (in the above chart), enabling the columnar engine improves recall from roughly </span><strong style="vertical-align: baseline;">0.78 to over 0.94 </strong><span style="vertical-align: baseline;">– a </span><strong style="vertical-align: baseline;">0.163 recall gain</strong><span style="vertical-align: baseline;">. This means your AI applications get much more accurate results without any latency impact.</span></li> </ol> <p><span style="vertical-align: baseline;">It is important to note that the baseline (blue line) already represents the index being fully cached in the PostgreSQL shared buffer cache. The performance gains shown here are not the result of moving data from disk to RAM, but rather the result of a more efficient memory architecture.</span></p> <h3><strong style="vertical-align: baseline;">How it works: Columnar engine Accelerated HNSW</strong></h3> <p><span style="vertical-align: baseline;">In standard PostgreSQL architectures, index operations utilize the shared buffer cache. Even when data is fully in-memory, the database still incurs significant overhead from the buffer manager, which must handle operations such as page pinning and unpinning, lock acquisition, buffer table lookups, and Least Recently Used (LRU) management.</span></p> <p><span style="vertical-align: baseline;">AlloyDB's </span><strong style="vertical-align: baseline;">columnar engine </strong><span style="vertical-align: baseline;">is a built-in, in-memory cache that stores data in a specialized, scan-optimized format.</span></p> <p><span style="vertical-align: baseline;">With this release, AlloyDB can use </span><strong style="vertical-align: baseline;">columnar engine accelerated HNSW </strong><span style="vertical-align: baseline;">to:</span></p> <ul> <li role="presentation"><strong style="vertical-align: baseline;">Pin the index: </strong><span style="vertical-align: baseline;">The </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> HNSW index is pinned (kept persistently in-memory to ensure fast access) directly into the columnar engine’s memory.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Vectorized access: </strong><span style="vertical-align: baseline;">It utilizes a memory layout specifically designed for the high-concurrency, pointer-heavy traversals required by HNSW graphs.</span></li> <li role="presentation"><strong style="vertical-align: baseline;">Bypass buffer overhead: </strong><span style="vertical-align: baseline;">By navigating the graph in a specialized memory space, AlloyDB avoids the standard buffer manager bottlenecks. This architectural shift is what enables the dramatic QPS and recall improvements shown above, even when comparing against a fully-cached standard index.</span></li> </ul> <h3><strong style="vertical-align: baseline;">Why it Matters</strong></h3> <p><span style="vertical-align: baseline;">For enterprise-scale applications, this isn't just about a faster database—it's about cost and quality:</span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Reduced infrastructure costs:</strong><span style="vertical-align: baseline;"> Achieve the same performance with significantly lower compute resources.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">Better AI accuracy:</strong><span style="vertical-align: baseline;"> Reach higher recall and quality at speeds that were previously only possible for "draft" (high-speed, lower-accuracy results) quality search.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><strong style="vertical-align: baseline;">No application changes required:</strong><span style="vertical-align: baseline;"> Because this is built into AlloyDB, you get these gains using the same standard </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;"> SQL syntax.</span></p> </li> </ul> <p><span style="vertical-align: baseline;">Note that the columnar engine does utilize memory, but it is highly compressed and meticulously managed. Because the engine stores vector data in an efficient columnar format, the memory footprint is minimal compared to the massive performance gains—making it a highly favorable trade-off for enterprise workloads.</span></p> <h3><strong style="vertical-align: baseline;">Quick Start Guide</strong></h3> <p><span style="vertical-align: baseline;">To try out </span><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><strong style="text-decoration: underline; vertical-align: baseline;">columnar engine accelerated HNSW</strong></a><span style="vertical-align: baseline;"> in AlloyDB, follow these steps:</span></p> <p><span style="vertical-align: baseline;">1. </span><strong><a href="https://docs.cloud.google.com/alloydb/docs/ai/accelerate-with-ce"><span style="text-decoration: underline; vertical-align: baseline;">Enable the columnar engine</span></a><span style="vertical-align: baseline;"> and index caching</span></strong></p> <p><span style="vertical-align: baseline;">Ensure that both </span><code style="vertical-align: baseline;">google_columnar_engine.enabled</code><span style="vertical-align: baseline;"> and </span><code style="vertical-align: baseline;">google_columnar_engine.enable_index_caching</code><span style="vertical-align: baseline;"> flags are set to </span><code style="vertical-align: baseline;">on</code><span style="vertical-align: baseline;"> for your AlloyDB instance.</span></p> <p><span style="vertical-align: baseline;">2. <strong>Add the HNSW Index to columnar engine</strong></span></p> <p><span style="vertical-align: baseline;">Once your HNSW index is created via </span><code style="vertical-align: baseline;">pgvector</code><span style="vertical-align: baseline;">, execute the following SQL command to cache it in the columnar engine:</span></p></div> <div class="block-code"><dl> <dt>code_block</dt> <dd>&lt;ListValue: [StructValue([(&#x27;code&#x27;, &quot;SELECT google_columnar_engine_add_index(&#x27;&lt;hnsw_index_name&gt;&#x27;);&quot;), (&#x27;language&#x27;, &#x27;&#x27;), (&#x27;caption&#x27;, &lt;wagtail.rich_text.RichText object at 0x7f0196625d90&gt;)])]&gt;</dd> </dl></div> <div class="block-paragraph_advanced"><p><span style="vertical-align: baseline;">3. <strong>Additional Resources</strong></span></p> <ul> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">New to AlloyDB? Discover AlloyDB with a </span><a href="https://docs.cloud.google.com/alloydb/docs/free-trial-cluster"><span style="text-decoration: underline; vertical-align: baseline;">30-day free trial</span></a><span style="vertical-align: baseline;">.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><a href="https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/alloydb/notebooks/columnar_engine_accelerated_hnsw_vector_search_benchmark.ipynb" rel="noopener" target="_blank"><span style="text-decoration: underline; vertical-align: baseline;">Google Colab Notebook</span></a><span style="vertical-align: baseline;">: An end-to-end Python script to ingest the GloVe dataset, create indexes, and plot Recall vs QPS curves.</span></p> </li> <li aria-level="1" style="list-style-type: disc; vertical-align: baseline;"> <p role="presentation"><span style="vertical-align: baseline;">Is HNSW the right vector index choice for your use case? Check our ‘</span><a href="https://docs.cloud.google.com/alloydb/docs/ai/choose-index-strategy"><span style="text-decoration: underline; vertical-align: baseline;">Choose a vector index in AlloyDB AI</span></a><span style="vertical-align: baseline;">’ guide.</span></p> </li> </ul></div> Maestro News, gelişmeyi Maestro Dev ekseninde — yazılım, yapay zekâ, bulut ve ürün teslimatı — özgün dilde yeniden çerçeveliyor.
Maestro Dev bakışı nedir?
Ürün stratejisi, mühendislik ve yapay zekâ teslimatı üzerinden okunan sektörel bir sinyal.
Kaynak ve alıntı nasıl kullanıldı?
Haber Google Cloud Blog akışından alındı; kısa alıntı atıflı, gövde özgün.


