[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThe AlloyDB Omni columnar engine accelerates SQL query processing for scans, joins, and aggregates by using a column-oriented format for selected columns.\u003c/p\u003e\n"],["\u003cp\u003eThe columnar engine can be used on primary and read pool instances and it uses a default 1 GB of instance memory, which can be adjusted according to workload and read pool configuration.\u003c/p\u003e\n"],["\u003cp\u003eTo leverage the columnar engine, referenced columns in the SQL query must be present in the column store, which can be done through manual configuration or auto-columnarization.\u003c/p\u003e\n"],["\u003cp\u003eThe columnar engine supports a variety of common data types but has limitations, such as not supporting non-leaf partitioned tables or tables with fewer than 5,000 rows, and it may prefer the row-store over the column-store if there are indexes on a column being queried.\u003c/p\u003e\n"],["\u003cp\u003eCertain queries benefit more from the columnar engine such as table scans with filters, aggregation functions, and selective joins, as long as they meet specific criteria such as being at the beginning of the query, and also there are functions to monitor it's usage and verify if it has been used in a given query.\u003c/p\u003e\n"]]],[],null,["# Columnar engine overview\n\nSelect a documentation version: Current (16.8.0)keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/columnar-engine/overview)\n- [16.8.0](/alloydb/omni/16.8.0/docs/columnar-engine/overview)\n- [16.3.0](/alloydb/omni/16.3.0/docs/columnar-engine/overview)\n- [15.12.0](/alloydb/omni/15.12.0/docs/columnar-engine/overview)\n- [15.7.1](/alloydb/omni/15.7.1/docs/columnar-engine/overview)\n- [15.7.0](/alloydb/omni/15.7.0/docs/columnar-engine/overview)\n\n\u003cbr /\u003e\n\nThis page describes the AlloyDB Omni columnar engine and provides instructions about how to use the engine in container and Kubernetes cluster installations. This page assumes you are familiar with PostgreSQL.\n\n\u003cbr /\u003e\n\nThe AlloyDB Omni columnar engine accelerates SQL query\nprocessing of scans, joins, and aggregates by providing the following components:\n\n- A column store that contains table and materialized-view data for selected\n columns, reorganized into a column-oriented format.\n\n- A columnar query planner and execution engine that supports\n use of the column store in queries.\n\nYou can use the columnar engine on the primary instance, a read pool instance, or both.\nYou can also use [auto-columnarization](/alloydb/omni/current/docs/columnar-engine/manage-content-recommendations#default-schedule)\nto analyze your workload and automatically populate the column store with the columns\nthat provide the best performance gain.\n\nTo use the columnar engine with a specific query, all columns referenced in the query,\nsuch as joins, scans, must be in the column store.\n\nBy default, the columnar engine is set to use 1 GB of your instance's memory.\nDepending on your workload, memory usage, and if you have a read pool configured,\nyou can choose to reduce the columnar engine memory allocation on your primary\ninstance and allocate more memory to the read pool instance.\n\nTo view and monitor memory usage by the columnar\nengine, see [View column store memory usage](/alloydb/omni/current/docs/columnar-engine/monitor#usage).\nTo modify the memory size used by the column store, see\n[Configure the size of the column store](/alloydb/omni/current/docs/columnar-engine/configure#configure).\nTo find the recommended columnar engine memory size for your instance, see\n[Recommend column store memory size](/alloydb/omni/current/docs/columnar-engine/manage-content-recommendations#recommend-populate).\n\nQuery types that benefit from the columnar engine\n-------------------------------------------------\n\nCertain queries can benefit from the columnar engine. The following is a list of\noperations and their query patterns that benefit most from the columnar engine:\n\nFor more information on which queries work best with the columnar engine, whether\nthe columnar engine was used by a query, and how it was used, see\n[Verify usage of the columnar engine using `EXPLAIN`](/alloydb/omni/current/docs/columnar-engine/monitor#explain).\n\nHow to use the columnar engine in an AlloyDB Omni instance\n----------------------------------------------------------\n\nTo use the columnar engine in an AlloyDB Omni instance, you perform these\nhigh-level steps:\n\n1. [Enable the engine](/alloydb/omni/current/docs/columnar-engine/configure#enable) on the instance.\n\n Enabling the engine is a one-time operation and requires a database restart.\n2. Add columns to the column store.\n\n To add columns to the column store, use one of the following methods:\n - [Use auto-columnarization](/alloydb/omni/current/docs/columnar-engine/manage-content-recommendations),\n which analyzes your workload and automatically adds columns.\n\n - [Add the columns manually](/alloydb/omni/current/docs/columnar-engine/manage-content-manually)\n based on your knowledge of the workload on the databases in the instance.\n\n3. You can track what's in the column store using [the `g_columnar_relations`\n view](/alloydb/omni/current/docs/columnar-engine/monitor#relations-view), and, after\n columns have been added, you can use [the `EXPLAIN`\n statement](/alloydb/omni/current/docs/columnar-engine/monitor#explain) to verify usage of\n the columnar engine in SQL queries.\n\nFor detailed instructions on how to use the columnar engine, see\n[Configure the columnar engine](/alloydb/omni/current/docs/columnar-engine/configure).\n\nWhat data you can add to the column store\n-----------------------------------------\n\nThere are some limitations on the data types and data sources you can use\nwhen adding columns to the column store.\n\n### Supported data types\n\nThe columnar engine supports only columns with the following built-in\ndata types:\n\n- `array`\n- `bigint`\n- `boolean`\n- `bytea`\n- `char`\n- `date`\n- `decimal`\n- `double precision`\n- `enum`\n- `float4`\n- `float8`\n- `integer`\n- `json`\n- `jsonb`\n- `numeric`\n- `real`\n- `serial`\n- `short`\n- `smallint`\n- `text`\n- `timestamp`\n- `uuid`\n- `varchar`\n\nThe columnar engine ignores any attempts to manually add columns with unsupported\ndata types to the column store.\n\n### Unsupported data sources\n\nThe columnar engine does not support tables or materialized views with the\nfollowing attributes as data sources:\n\n- Non-leaf partitioned tables\n\n- Foreign tables\n\n- Tables or views with fewer than 5,000 rows\n\nColumnar engine limitations\n---------------------------\n\n- If you're running an analytical query on a column that has an index, the AlloyDB Omni optimizer might choose to use row-store.\n- Columns added manually to the column store aren't automatically removed. To force remove manually added columns, use [`google_columnar_engine_drop`](/alloydb/omni/current/docs/columnar-engine/manage-content-manually#drop-by-function) on your instance.\n- Auto-columnarization might dynamically add and remove columns based on query usage.\n- Not all data types are supported by the columnar engine. To see supported data types, see [supported data types](#supported-data-types).\n- Frequent updates to rows invalidate columnar data. To validate a table or a\n materialized view in the columnar store, you can either reduce the update\n frequency, or\n [schedule the columnar engine refreshes more frequently](/alloydb/omni/current/docs/columnar-engine/manage-content-recommendations#auto-schedule).\n\n You can compare the `invalid_block_count` and `total_block_count` columns in\n [`g_columnar_relations`](/alloydb/omni/current/docs/columnar-engine/monitor#relations-view)\n to check if your table or view is impacted. If you have frequent or high-volume changes to your table or view, the `invalid_block_count` will be high.\n\nWhat's next\n-----------\n\n- [Configure the columnar engine on AlloyDB Omni](/alloydb/omni/current/docs/columnar-engine/configure)"]]