partition_keys is a child of
derived_table is a child of
a column from
the derived table
partition_keys supports database dialects that have the ability to partition columns. When a query is run that is filtered on a partitioned column, the database will only scan those partitions that include the filtered data, rather than scanning the entire table. Because a smaller subsection of the table is being scanned, this can significantly reduce the time and cost of querying large PDTs when the appropriate partition and filter is specified.
When creating a persistent derived table (PDT), if your underlying Presto or BigQuery database table uses partitioning, Looker can use that partitioning. In BigQuery, partitioning can only be used on one table column which must be a date/time column — so a Looker PDT based on a BigQuery table can only use partitioning on one date/time column.
To add a partitioned column to a PDT, use
partition_keys and supply the names of the corresponding columns that are partitioned in the database table.
Create a customer_day_facts native derived table on a BigQuery database with a partition key on the date column:
Create a customer_day_facts SQL-based derived table on a Presto database with partition keys on the date and state columns: