> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google BigQuery

## Time-travel support

BigQuery supports time-travel, which means that querying the past is possible and queries stay consistent if the data in BigQuery is updated.<br />
When creating new epochs for the Database, DirectQuery automatically snapshots the current timestamp and use it.

Querying past snapshots is done by using the `FOR SYSTEM_TIME AS OF` SQL syntax.
As such, when the historical data becomes unavailable, this is reflected in DirectQuery and queries against those old versions will fail.

## Vector supports

Only [multi-rows vectors](../vectors#emulation-with-multiple-columns) and [multi-columns vectors](../vectors#emulation-with-multiple-rows) are supported by BigQuery.

The array type [available in BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#array_type) does not offer powerful aggregation functions to work with them.

## Gotchas

### Nullable fields

BigQuery can define fields with nullable types.
DirectQuery is capable of detecting this and defines its internal model accordingly.<br />
While this is not a problem in itself, it can conflict with the rule in Atoti cubes that all levels must be based on non-nullable values.
This does not create an issue of any sort as the local model is updated behind the scene, assigning a default value based on the type.<br />
It has a side effect on the query performance, as DirectQuery must convert on-the-fly null values to their assigned default values, as well as adding extra conditions during joins to handle null values on both sides.

### Foreign keys

Joins between tables perform faster when the keys are of an integer type (such as `INT64`).
It's advised to avoid other types, such as `String`.
