distribution_style

사용

view: my_view {
  derived_table: {
    distribution_style: all
    ...
  }
}
계층 구조
distribution_style

- 또는 -

distribution_style
기본값
없음

수락
분산 스타일 (all 또는 even)
특별 규칙
distribution_style특정 방언에서만 지원됩니다.

정의

distribution_style를 사용하면 영구 파생 테이블 (PDT) 또는 집계 테이블의 쿼리가 데이터베이스의 노드에 분산되는 방식을 지정할 수 있습니다.

distribution_style을 지원하는 언어 목록은 distribution_style 언어 지원 섹션을 참고하세요.

distribution_style 매개변수는 PDT 및 집계 테이블과 같이 영구 테이블에서만 작동합니다. distribution_style는 지속성 전략이 없는 파생 테이블에 지원되지 않습니다.

또한 create_process 또는 sql_create를 사용하여 정의된 파생 테이블에는 distribution_style 매개변수가 지원되지 않습니다.

마지막으로 distribution_styledistribution를 동시에 사용해서는 안 됩니다. 열 값을 기준으로 테이블의 행을 여러 Redshift 노드에 분산하려면 distribution를 사용하세요. 그렇지 않으면 distribution_style를 사용하여 다른 배포 전략을 선택합니다.

Redshift는 배포 스타일 관련 Amazon Redshift 문서에 설명된 네 가지 배포 스타일을 제공합니다.

  • ALL 배포: 모든 행이 각 노드에 완전히 복사됩니다. Looker에서 distribution_style: all를 사용하여 이러한 유형의 분포를 달성할 수 있습니다.
  • 균등 분산: 행이 라운드 로빈 방식으로 여러 노드에 분산됩니다. Looker에서 distribution_style: even를 사용하여 이러한 유형의 분포를 달성할 수 있습니다.
  • KEY 분산: 특정 열 내의 고유 값을 기준으로 행이 여러 노드로 분산됩니다. Looker에서 distribution 매개변수를 사용하여 이러한 유형의 분포를 달성할 수 있습니다.
  • AUTO Distribution Redshift는 테이블 데이터의 크기를 기반으로 최적의 배포 스타일을 할당합니다. Looker에서는 이 분포 유형을 지원하지 않습니다.

적절한 배포 전략을 선택하려면 배포 스타일 관련 Amazon Redshift 문서를 참고하세요. distribution_style를 지정하지 않고 distribution 매개변수를 대신 사용하지 않으면 Looker는 기본적으로 all로 설정됩니다.

예시

분산 스타일이 allcustomer_order_facts 파생 테이블을 만듭니다.

view: customer_order_facts {
  derived_table: {
    sql:
      SELECT
        customer_id,
        COUNT(*) AS lifetime_orders
      FROM
        order
      GROUP BY 1 ;;
    persist_for: "24 hours"
    distribution_style: all
  }
}

distribution_style의 언어 지원

distribution_style을 사용할 수 있는지 여부는 Looker 연결에서 사용하는 데이터베이스 언어에 따라 다릅니다. 최신 버전의 Looker에서는 다음 언어가 distribution_style를 지원합니다.

언어 지원 여부
Actian Avalanche
Amazon Athena
Amazon Aurora MySQL
Amazon Redshift
Amazon Redshift 2.1+
Amazon Redshift Serverless 2.1+
Apache Druid
Apache Druid 0.13+
Apache Druid 0.18+
Apache Hive 2.3+
Apache Hive 3.1.2+
Apache Spark 3+
ClickHouse
Cloudera Impala 3.1+
Cloudera Impala 3.1+ with Native Driver
Cloudera Impala with Native Driver
DataVirtuality
Databricks
Denodo 7
Denodo 8 & 9
Dremio
Dremio 11+
Exasol
Google BigQuery Legacy SQL
Google BigQuery Standard SQL
Google Cloud PostgreSQL
Google Cloud SQL
Google Spanner
Greenplum
HyperSQL
IBM Netezza
MariaDB
Microsoft Azure PostgreSQL
Microsoft Azure SQL Database
Microsoft Azure Synapse Analytics
Microsoft SQL Server 2008+
Microsoft SQL Server 2012+
Microsoft SQL Server 2016
Microsoft SQL Server 2017+
MongoBI
MySQL
MySQL 8.0.12+
Oracle
Oracle ADWC
PostgreSQL 9.5+
PostgreSQL pre-9.5
PrestoDB
PrestoSQL
SAP HANA
SAP HANA 2+
SingleStore
SingleStore 7+
Snowflake
Teradata
Trino
Vector
Vertica