- or -
AcceptsThe names of one or more columns in a PDT or an aggregate table
See the Dialect support for
sortkeyssection below for the list of dialects that support
You can also create an interleaved sort key by using
indexes instead. You cannot use both at the same time, but at least one is required.
Generally speaking, a sort key should be applied to date or time columns in the table, and possibly to columns that will be used frequently as filters. More information can be found in the Amazon Redshift documentation.
These examples assume that you are working with a Redshift database so that you can use the
customer_day_facts derived table that is based on a SQL query and has a sortkey on
customer_day_facts derived table that is based on a SQL query with a sortkey on
Dialect support for
The ability to use
sortkeys depends on the database dialect your Looker connection is using. In Looker 22.6, the following dialects support
Traditional SQL dialects (such as MySQL and Postgres) should use
sortkeyswill not work with these databases.