Redshift: Slow read speeds

0

We have a golang client running on k8s pod reading data from redshift table. Table has 50 columns and 10 million records and query looks like this

select * from tablename where id > 0 and id < 5000000

we are seeing that reading 5000 records is taking around 30 seconds which is very slow. what are the redshift metrics one should look at in these cases?

  • Why are you getting 5M records from Redshift at a time? That isn't a typical pattern for Redshift.

질문됨 2년 전1179회 조회
2개 답변
1

Redshift is a columnar database. So instead of using select * from a table, selecting specific columns will perform lot better. Based on query you have provided, please try creating sort key on column id and see if it helps. Typically Redshift takes care of updating statistics automatically but you can also update it using analyze table command. https://docs.aws.amazon.com/redshift/latest/dg/t_Analyzing_tables.html

AWS
전문가
Nita_S
답변함 2년 전
0

Hello, to improve performance for this specific query and table, I would first explore data model optimizations such as ensuring that you have optimal compression and sort keys (e.g. id column) for the table (distribution style is also important in most cases but since this query doesn't involve joins, not so much). You can easily add these characteristics to your table via the ALTER command. Try looking at the Redshift Advisor recommendations in the Redshift console to see if there any data model optimizations recommended by the Redshift ML algorithms. Another aspect worth considering is if you have an underpowered Redshift cluster vis-a-vis this workload and/or other concurrent workloads. Try examining the CPU utilization for example to see if it is peaking. Try experimenting with an increased node count to see if it results in improved query runtimes.

AWS
asser_m
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인