Usage
derived_table: {
distribution_style: all
…
}
}
Hierarchydistribution_style - or - distribution_style |
Default ValueNoneAcceptsA distribution style (all or even )
Special Rulesdistribution_style is supported only on specific dialects
|
Definition
distribution_style
lets you specify how the query for a persistent derived table (PDT) or an aggregate table is distributed across the nodes in a database.
See the Dialect support for
distribution_style
section below for the list of dialects that supportdistribution_style
.
The
distribution_style
parameter works only with tables that are persistent, such as PDTs and aggregate tables.distribution_style
is not supported for derived tables without a persistence strategy.In addition, the
distribution_style
parameter is not supported for derived tables that are defined usingcreate_process
orsql_create
.Lastly,
distribution_style
anddistribution
should not be used at the same time. If you want to distribute the rows of a table to different Redshift nodes based on a column value, usedistribution
. Otherwise, usedistribution_style
to choose a different distribution strategy.
Redshift offers three distribution styles, which are described in their documentation:
- All Distribution: All rows are fully copied to each node. You can accomplish this type of distribution in Looker by using
distribution_style: all
. - Even Distribution: Rows are distributed to different nodes in a round-robin fashion. You can accomplish this type of distribution in Looker by using
distribution_style: even
. - Key Distribution: Rows are distributed to different nodes based on unique values within a particular column. You can accomplish this type of distribution in Looker by using the
distribution
parameter.
See the Amazon Redshift documentation for choosing the appropriate distribution strategy. If you do not specify a distribution_style
, and do not use the distribution
parameter instead, Looker will default to all
.
Examples
Create a customer_order_facts
derived table with a distribution style of all
:
Dialect support for distribution_style
The ability to use distribution_style
depends on the database dialect your Looker connection is using. In Looker 22.6, the following dialects support distribution_style
: