Redshift Spectrum Performance与Athena相比

问题描述 投票:0回答:1

我在S3中有一个带有镶木地板文件的桶,并按日期分区。

使用以下查询:

select
    count(1)
from logs.logs_prod
where partition_1 = '2019' and partition_2 = '03'

直接在Athena中运行该查询,它在不到10秒的时间内执行。但是当我在Redshift中运行相同的查询时,它需要花费3分钟。它们都返回相同的正确值,在这种情况下,该分区中的行数少于8万行。

我正在使用AWS Glue作为Athena和Redshift的元数据存储。

Redshift的查询计划如下:

QUERY PLAN
XN Limit  (cost=250000037.51..250000037.51 rows=1 width=8)
  ->  XN Aggregate  (cost=250000037.51..250000037.51 rows=1 width=8)
        ->  XN Partition Loop  (cost=250000000.00..250000035.00 rows=1000 width=8)
              ->  XN Seq Scan PartitionInfo of logs.logs_prod  (cost=0.00..15.00 rows=1 width=0)
                    Filter: (((partition_1)::text = '2019'::text) AND ((partition_2)::text = '03'::text))
              ->  XN S3 Query Scan logs_prod  (cost=125000000.00..125000010.00 rows=1000 width=8)
                    ->  S3 Aggregate  (cost=125000000.00..125000000.00 rows=1000 width=0)
                          ->  S3 Seq Scan logs.logs_prod location:"s3://logs-prod/" format:PARQUET  (cost=0.00..100000000.00 rows=10000000000 width=0)

此问题是Redshift Spectrum配置问题吗? Redshift中的查询是否可能无法在Athena附近执行?

amazon-athena amazon-redshift-spectrum
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.