The AlloyDB Omni columnar engine accelerates SQL query
processing of scans, joins, and aggregates by providing the following components:
A column store that contains table and materialized-view data for selected
columns, reorganized into a column-oriented format.
A columnar query planner and execution engine that supports
use of the column store in queries.
You can use the columnar engine on the primary instance, a read pool instance, or both.
You can also useauto-columnarizationto analyze your workload and automatically populate the column store with the columns
that provide the best performance gain.
To use the columnar engine with a specific query, all columns referenced in the query,
such as joins, scans, must be in the column store.
By default, the columnar engine is set to use 1 GB of your instance's memory.
Depending on your workload, memory usage, and if you have a read pool configured,
you can choose to reduce the columnar engine memory allocation on your primary
instance and allocate more memory to the read pool instance.
Certain queries can benefit from the columnar engine. The following is a list of
operations and their query patterns that benefit most from the columnar engine:
Operation
Query patterns
Table scan
Selective filters, such asWHEREclauses. A small number of columns from a larger table or materialized view. Expressions such asLIKE,SUBSTR, orTRIM.
Aggregation functions
Only expressions such asSUM,MIN,MAX,AVG, andCOUNT. At the beginning of the query of a columnar scan. Ungrouped or grouped by columns.
ORDER-BY
Only if the operator is at the beginning of the
query of a columnar scan.
SORT
Only if the operator is at the beginning of the
query of a columnar scan and sorts only on the base columns of the table or
the materialized view.
LIMIT
Only if the operator is at the beginning of the query
of a columnar scan and is before anySORTorGROUP BYoperators.
INNER HASH JOIN
Only if the keys used are columns and no join qualifiers are used.
Selective joins
Only if the joins are at the beginning of the query of a columnar scan.
For more information on which queries work best with the columnar engine, whether
the columnar engine was used by a query, and how it was used, seeVerify usage of the columnar engine usingEXPLAIN.
How to use the columnar engine in an AlloyDB Omni instance
To use the columnar engine in an AlloyDB Omni instance, you perform these
high-level steps:
Add the columns manuallybased on your knowledge of the workload on the databases in the instance.
You can track what's in the column store usingtheg_columnar_relationsview, and, after
columns have been added, you can usetheEXPLAINstatementto verify usage of
the columnar engine in SQL queries.
There are some limitations on the data types and data sources you can use
when adding columns to the column store.
Supported data types
The columnar engine supports only columns with the following built-in
data types:
array
bigint
boolean
bytea
char
date
decimal
double precision
enum
float4
float8
integer
json
jsonb
numeric
real
serial
short
smallint
text
timestamp
uuid
varchar
The columnar engine ignores any attempts to manually add columns with unsupported
data types to the column store.
Unsupported data sources
The columnar engine does not support tables or materialized views with the
following attributes as data sources:
Non-leaf partitioned tables
Foreign tables
Tables or views with fewer than 5,000 rows
Columnar engine limitations
If you're running an analytical query on a column that has an index,
the AlloyDB Omni optimizer might choose to use row-store.
Columns added manually to the column store aren't automatically removed. To force remove
manually added columns, usegoogle_columnar_engine_dropon your instance.
Auto-columnarization might dynamically add and remove columns based on query
usage.
Not all data types are supported by the columnar engine. To see supported
data types, seesupported data types.
Frequent updates to rows invalidate columnar data. To validate a table or a
materialized view in the columnar store, you can either reduce the update
frequency, orschedule the columnar engine refreshes more frequently.
You can compare theinvalid_block_countandtotal_block_countcolumns ing_columnar_relationsto check if your table or view is impacted. If you have frequent or high-volume changes to your table or view, theinvalid_block_countwill be high.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe AlloyDB Omni columnar engine accelerates SQL query processing for scans, joins, and aggregates by using a column-oriented format for selected columns in tables and materialized views.\u003c/p\u003e\n"],["\u003cp\u003eThe columnar engine can be used on the primary instance, a read pool instance, or both, and it can utilize auto-columnarization to automatically select the most beneficial columns for performance gains.\u003c/p\u003e\n"],["\u003cp\u003eSpecific query types, such as those involving table scans, aggregation functions, \u003ccode\u003eORDER-BY\u003c/code\u003e, \u003ccode\u003eSORT\u003c/code\u003e, \u003ccode\u003eLIMIT\u003c/code\u003e, and certain joins, benefit most from the columnar engine.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize the columnar engine, it must be enabled on the instance (requiring a restart), and columns must be added to the column store, either manually or through auto-columnarization.\u003c/p\u003e\n"],["\u003cp\u003eThe columnar engine only supports specific data types, and it is not compatible with non-leaf partitioned tables, foreign tables, or tables/views with less than 5,000 rows.\u003c/p\u003e\n"]]],[],null,["# Columnar engine overview\n\nSelect a documentation version: 15.7.1keyboard_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/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/docs/columnar-engine/manage-content-recommendations),\n which analyzes your workload and automatically adds columns.\n\n - [Add the columns manually](/alloydb/omni/15.7.1/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/15.7.1/docs/columnar-engine/monitor#relations-view), and, after\n columns have been added, you can use [the `EXPLAIN`\n statement](/alloydb/omni/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/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/15.7.1/docs/columnar-engine/configure)"]]