[[["容易理解","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-05 (世界標準時間)。"],[],[],null,["# Spanner columnar engine overview\n\n| **Preview\n| --- [Spanner columnar engine](/spanner/docs/columnar-engine)**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n|\n|\n| For information about access to this\n| release, see the\n| [access request page](https://forms.gle/nE1bAqfHJrqhkStR9).\n\n\n| **PostgreSQL interface note:** The examples in this topic are intended for GoogleSQL-dialect databases. This feature doesn't support PostgreSQL interface.\n\n\u003cbr /\u003e\n\nThis page provides an overview of the columnar engine for Spanner\nand describes how to use it.\n\nOperational databases commonly extract, transform, and load (ETL) data into an\nOLAP system for analytics. This system is often part of a data warehouse. With\n[Data Boost](/spanner/docs/databoost/databoost-overview), Spanner\nalready separates analytical compute, which ensures transactional stability.\n\nColumnar engine is a storage technique that analytics systems use to speed\nup scans when compared to batch-based scans. Spanner columnar\nengine lets you run analytics with significantly improved performance on the\nlatest operational data. Spanner columnar engine increases scan\nperformance by up to 200 times, eliminating the need for ETL while maintaining\nstrong consistency.\n\nSpanner's\n[Ressi](/blog/products/databases/spanner-modern-columnar-storage-engine) format\nuses a partition attributes across (PAX) column-wise layout for efficient scans\nwithin a data block. However, this format colocates all columns of a row within\na given block for fast single-row lookups. Unlike Ressi,\nSpanner's columnar engine dedicates runs of blocks to a single\ncolumn. This approach is more efficient for sequential scans, as\nSpanner only needs to read the columns referenced in the query.\n\nSpanner builds the columnar representation in the background (as\npart of compactions), and automatically merges the representation with the\nlatest updates at query time to provide strong consistency. Queries that\nwouldn't benefit from columnar storage can continue to use PAX.\n\nWorkloads that would benefit from using columnar engine include the following:\n\n- Operational reporting extract up-to-the-second business intelligence from the latest operational data.\n- Served analytics power dashboards and custom drill-downs with interactive latency.\n- Federated analytics seamlessly combine data from Spanner and other sources in BigQuery.\n\n[Spanner instance backups](/spanner/docs/backup) don't include\nthe columnar format.\n\nBest practices for using columnar engine\n----------------------------------------\n\nThis section describes best practices when using columnar engine.\n\n### Large scan optimization\n\nColumnar engine optimizes queries that scan large amounts of data. For smaller\ndata scans or queries with quickly satisfied `LIMIT` clauses, row-based scans\nmight be more efficient.\n\n### Essential columns\n\nIf you use `SELECT *`, Spanner reads all columns from columnar\nstorage. To maximize performance, specify only necessary columns. For example,\n`SELECT column1, column2 FROM ...`.\n\n### Performance bottleneck identification\n\nColumnar engine is effective for scan-bound workloads. To identify a scan-bound\nworkload, check the [query plan](/spanner/docs/query-execution-plans) for a high\nlatency level in the **Table scan** node. If your query isn't scan-bound,\nprioritize other optimizations first. Columnar engine can provide benefits\nlater if your optimizations make the query scan-bound.\n\n### Optimal columnar coverage\n\nAfter you [enable columnar engine](/spanner/docs/configure-columnar-engine#enable-columnar-engine)\non a database that already contains data, Spanner's automatic\ncompaction process converts data to columnar storage asynchronously in the\nbackground. To see how much your query benefits, check the\n[**Columnar read share** percentage](/spanner/docs/monitor-columnar-engine#columnar-data-query-plan)\nin the query plan.\n\n### High churn data management\n\nHigh write rates from updates or random inserts can affect the columnar engine's\nperformance. Append-only workloads experience minimal impact from using columnar\nengine. Compaction is a background process, which typically is spread out over\nmultiple days, but can happen sooner if the size of the database grows\nsubstantially. Alternatively, design the schema to favor append-only writes at\nthe split level. For more information, see\n[sharding of timestamp-ordered data in Spanner](/blog/products/gcp/sharding-of-timestamp-ordered-data-in-cloud-spanner).\n\nPricing\n-------\n\nBilling for the Spanner columnar engine is based on storage\nusage. After you enable the Spanner columnar engine and\nSpanner completes data compaction, storage usage increases to\ninclude the new columnar representation. Columnar engine provides storage\nmetrics that let you monitor the impact to storage. For more information, see\n[Columnar data storage metrics](/spanner/docs/monitor-storage-usage#monitor-storage-usage).\n\nSpanner columnar engine isn't impacted by the [8 bytes per cell\noverhead](/spanner/docs/reference/standard-sql/data-types#storage_size_for_data_types).\n\nPreview limitations\n-------------------\n\n- You must use explicit hints to enable columnar reads for queries that you make directly to Spanner or by using BigQuery `EXTERNAL_QUERY`. For more information, see [Query columnar data](/spanner/docs/query-columnar-data).\n- Columnar engine only supports the GoogleSQL interface.\n- Scans that lack selective filters might see less improvement.\n\nWhat's next\n-----------\n\n- Learn how to [enable columnar engine](/spanner/docs/configure-columnar-engine).\n- Learn how to [query columnar data](/spanner/docs/query-columnar-data).\n- Learn how to [monitor columnar engine](/spanner/docs/monitor-columnar-engine)."]]