Introduction to tables
BigQuery tables let you store and query your data as individual records organized in rows, where each record is composed of columns, also called fields. Every table is defined by a schema that describes the column names, data types, and other information.
This document describes the types of tables in BigQuery, how you can organize table storage by using partitioning and clustering, and table limitations, quotas, pricing, and security.
Table types
The following sections describe the table types that BigQuery supports.
- Standard BigQuery tables: structured data stored in BigQuery storage.
- External tables: tables that reference data stored outside BigQuery.
- Views: logical tables that are created by using a SQL query.
You can specify the schema of a table when it is created, or you can create a table without a schema and declare the schema in the query job or load job that first populates it with data.
Use the format projectname.datasetname.tablename to fully qualify a table name
when using GoogleSQL, or the format
projectname:datasetname.tablename to fully qualify a table name when using the
bq command-line tool.
Standard BigQuery tables
Standard BigQuery tables contain structured data and are stored
in BigQuery storage in a columnar format. You can also store
references to unstructured data in standard tables by using struct columns that
adhere to the ObjectRef format. For more
information about working with ObjectRef values, see Specify ObjectRef
columns in table schemas.
BigQuery has the following table types:
Tables, which have a schema and every column in the schema has a data type.
For information about how to create tables, see Create tables.
Table clones, which are lightweight, writable copies of BigQuery tables. BigQuery only stores the delta between a table clone and its base table.
For information about how to create table clones, see Create table clones.
Table snapshots, which are point-in-time copies of tables. They are read-only, but you can restore a table from a table snapshot. BigQuery stores bytes that are different between a snapshot and its base table, so a table snapshot typically uses less storage than a full copy of the table.
For information about how to create table snapshots, see Create table snapshots.
External tables
External tables are stored outside of BigQuery storage and refer to data that's stored outside of BigQuery. For more information, see Introduction to external data sources. External tables include the following types:
BigLake tables, which reference structured data stored in datastores such as Cloud Storage, Amazon Simple Storage Service (Amazon S3), and Azure Blob Storage. These tables let you enforce fine-grained security at the table level.
For information about how to create BigLake tables, see the following topics:
Object tables, which reference unstructured data stored in datastores such as Cloud Storage.
For information about how to create object tables, see Create object tables.
Non-BigLake external tables, which reference structured data stored in datastores such as Cloud Storage, Google Drive, and Bigtable. Unlike BigLake tables, these tables don't let you enforce fine-grained security at the table level.
For information about how to create non-BigLake external tables, see the following topics:
Views
Views are logical tables that are defined by using a SQL query. These include the following types:
Views, which are logical tables that are defined by using SQL queries. The query that defines the view is run each time the view is queried.
For information about how to create views, see Create views.
Materialized views, which are precomputed views that periodically cache the results of the view query. The cached results are stored in BigQuery storage.
For information about how to create materialized views, see Create materialized views.
Table partitioning and clustering
Partitioning and clustering aren't separate table types. They're storage properties that you can apply to a table to control how BigQuery physically organizes the table's data. Both features let queries that filter on specific columns scan less data, which can improve query performance and reduce query costs. You can apply either feature on its own, or combine both on the same table.
For information about how to create partitioned tables, see Create partitioned tables.
For information about how to create clustered tables, see Create clustered tables.
Support for partitioning and clustering by table type
The following partitioning and clustering options are available depending on the table type:
- Standard BigQuery tables. You can partition, cluster, or both partition and cluster standard tables.
- Table clones and table snapshots. Supported as with standard tables. Table snapshots are read-only and preserve the partitioning and clustering of the base table. Partitions can also help reduce the storage costs of clones and snapshots, because BigQuery only copies modified data within a partition instead of the entire table. If you snapshot a partitioned table that has a partition expiration set, the partition expiration isn't retained in the snapshot. For more information, see Introduction to table clones and Introduction to table snapshots.
- External tables. External tables, including BigLake tables, don't support clustering. They support partitioning in a limited way: if the external data uses an Apache Hive partitioning layout or an Apache Iceberg partition spec, BigQuery can prune partitions when you filter on the partitioning columns. For more information, see Manage external Hive partitioned data.
- Views. Views are logical tables that don't store data, so you can't partition or cluster a view. However, queries against a view still benefit from the partitioning and clustering of the underlying base tables when a query against the view or the view definition filters on the partitioning or clustering columns.
- Materialized views. Because materialized views store precomputed results in BigQuery storage, you can cluster them and partition them to align with partitioned base tables. A materialized view over a metadata-cached BigLake table can't be partitioned, except for partition-aligned materialized views over partitioned Iceberg external tables. For more information, see Create materialized views.
Table limitations
BigQuery tables are subject to the following limitations:
- Table names must be unique per dataset.
- When you export BigQuery table data, the only supported destination is Cloud Storage.
- When you use an API call, enumeration performance slows as you approach 50,000 tables in a dataset.
- The Google Cloud console can display up to 50,000 tables for each dataset.
For information about limitations on partitioned tables, clustered tables, and external tables, see the following:
- Partitioned table limitations
- Clustered table limitations
- BigLake table limitations
- Object table limitations
- External table limitations
Table quotas
Quotas and limits apply to the different types of jobs you can run against tables, including the following quotas:
- Load data into tables (load jobs)
- Export data from tables (extract jobs)
- Query table data (query jobs)
- Copy tables (copy jobs)
For more information about all quotas and limits, see Quotas and limits.
For more information about troubleshooting quotas, see Troubleshoot quota and limit errors.
The following quota errors apply specifically to tables:
Table pricing
When you create and use tables in BigQuery, your charges are based on how much data is stored in the tables and partitions and on the queries you run against the table data:
- For information about storage pricing, see Storage pricing.
- For information about query pricing, see Query pricing.
Many table operations are free, including loading, copying, and exporting data. Though free, these operations are subject to BigQuery quotas and limits. For information about all free operations, see Free operations on the pricing page.
Table security
To control access to tables in BigQuery, see Control access to resources with IAM.
What's next
- Learn how to create and use tables.
- Learn how to manage tables.
- Learn how to modify table schemas.
- Learn about working with table data.
- Learn more about partitioned tables and
clustered tables.