Redshift Automatic Table Optimization and table swaps

0

A customer swaps out table nightly.

For example table_1 built last night. Then tonight:

  • table_1_tmp is built
  • table_1 renamed to table_1_stale
  • table_1_tmp renamed to table_1
  • table_1_stale is dropped

Customer wants know if the new "Automatic Table Optimization" discussed in the blog is able to recognize the table swaps when gathering data for recommendations.

Does it go by table name or a unique table identifier?

AWS
질문됨 3년 전754회 조회
1개 답변
0
수락된 답변

Redshift Automatic Table Optimization (ATO) uses the internal "table_id" identifier. As such ATO won't recognize the new table (after swapping) and won't automatically apply what what it had done previously. Of course not all is lost. You can create the new table_1_tmp by using "create table table_1_tmp (like table_1)". But to be sure that you want ATO to continue working on the new table, also do "ALTER TABLE table_1_tmp ALTER DISTSTYLE/SORTKEY AUTO".

More details. Redshift Automatic Table Optimization (ATO) uses the same mechanism as Redshift Advisor for sort and distribution key recommendations. With ATO, all recommendations are recorded in the SVV_ALTER_TABLE_RECOMMENDATIONS system table. If you take a closer look at its DDL:

https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_ALTER_TABLE_RECOMMENDATIONS.html

You will notice that it ONLY contains the internal "table_id" NOT the "table_name".

전문가
답변함 3년 전

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

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

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

관련 콘텐츠