Configure Spanner columnar engine Stay organized with collections Save and categorize content based on your preferences.
Preview —Spanner columnar engine
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
For information about access to this release, see the access request page.
Note: This feature is available with the Spanner Enterprise edition and Enterprise Plus edition. For more information, see theSpanner editions overview.
This page describes how to enable Spanner columnar engine on adatabase, table, or index, and accelerate file format generation.
Enable Spanner columnar engine
Spanner columnar engine is enabled using aSET OPTIONS clausewith thecolumnar_policy option. You can apply this option when you create oralterDATABASE,TABLE, orINDEX schema objects.SEARCH INDEX andVECTOR INDEX schema objects are never in columnar format.
Lower levels in a database and table hierarchy inherit thecolumnar_policyfrom its parent. You can change this setting at lower levels.
Thecolumnar_policy option has the following flags:
'enabled'or'disabled'turns the columnar engine on or off for thespecific schema object.NULL(default) uses the columnar engine policy from the parent object,if one exists.NULLclears previous settings on a table object.
You can also omitOPTIONS to inherit thecolumnar_policy from the parentobject.
The following example shows how to:
- Create a database with the columnar policy enabled.
- Define a
Singerstable that inherits the columnar policy from the database(omit thecolumnar_policy = NULLfor the table option). - Define a
Concertstable with the columnar policy explicitly disabled.
CREATEDATABASEMusic;ALTERDATABASEMusicSETOPTIONS(columnar_policy='enabled');CREATETABLESingers(SingerIdINT64NOTNULL,FirstNameSTRING(1024),LastNameSTRING(1024),BirthDateDATE,StatusSTRING(1024),LastUpdatedTIMESTAMP,)PRIMARYKEY(SingerId);CREATETABLEConcerts(VenueIdINT64NOTNULL,SingerIdINT64NOTNULL,ConcertDateDATENOTNULL,BeginTimeTIMESTAMP,EndTimeTIMESTAMP,)PRIMARYKEY(VenueId,SingerId,ConcertDate),OPTIONS(columnar_policy='disabled');You can also useALTER TABLE with theSET OPTIONS clause to enable ordisable thecolumnar_policy on a table. The following example shows how todisable the policy in theSingers table:
ALTERTABLESingersSETOPTIONS(columnar_policy='disabled');Columnar file format generation
Spanner generates the columnar file format at compaction time.Compaction is a background process that typically is spread out over multipledays, but it might happen sooner if the size of the database growssubstantially. For more information, seeOptimal columnar coverage.
Note: You can contactspanner-columnar-preview@google.comto request accelerated generation of columnar format for existing data.What's next
- Learn aboutcolumnar engine.
- Learn how toquery columnar data.
- Learn how tomonitor columnar engine.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.