What does it mean to have multiple sortkey columns?

后端 未结 3 515
温柔的废话
温柔的废话 2020-12-24 02:58

Redshift allows designating multiple columns as SORTKEY columns, but most of the best-practices documentation is written as if there were only a single SORTKEY.

3条回答
  •  无人及你
    2020-12-24 03:51

    I will say the order for sort_key should be

    1. consider those in dist, filter and join first
    2. consider those in filter, join
    3. consider those in filter
    4. consider those in join
    5. consider those in group by, order by (including window function)

    the general rule: lower cardinality put first if same level.

提交回复
热议问题