Full join issue: When use full join, the below join condition should not occur:

1, OR statement
2, an obvious false or true condition, like 1 = 0 or 1=1
3, the datatype of the join column should not be timestamp, this case is very common in pcp join, when use the report date as the join key.

ERROR: 42846: could not convert type "unknown" to numeric because of modifier

When the datatype of a column is supposed to be numeric in a UNION ALL context(basically there are more than three sub query parts), 
If there exists NULL value for some sub query, it is needed to cast the NULL value to the numeric datatype.

Error info: [Assert error]

This means the Redshift performance is bad, usually multiple large table join, more CTAS is needed.

Error info: query is automatically killed saying cancelled on user's request

Error info: could not devise a query plan for the given query

The issue is prabably due to there is an join condition in the full join clause. The join column is report_date, which is a date datatype, but there is function applied to report_date, which convert the datatype to timestamp. Unluckily redshift seems not supported this datatype in the join condition.

To solve this issue, we need to cast the join column to date again, like below:
DATEADD(MONTH,-12,CUR.REPORT_DATE) :: DATE = RESULT_PCP.REPORT_DATE ::DATE

Tips: Avoid to use the string concatenation when doing a join, create a temporary table for that particular column.

Redshift related documents

https://blogs.aws.amazon.com/bigdata/post/Tx31034QG0G3ED1/Top-10-Performance-Tuning-Techniques-for-Amazon-Redshift

http://docs.aws.amazon.com/redshift/latest/dg/c_Byte_dictionary_encoding.html

http://content.infotrustllc.com/interleaved-sorting-a-novel-solution-for-optimizing-multiple-query-patterns/

http://docs.aws.amazon.com/redshift/latest/dg/welcome.html

https://aws.amazon.com/redshift/pricing/

Sort key testing
Currently test on a table about 10millon rows, no significant difference, Need a larger data set to do the testing.

Previously, the table with sort key is not applied column compression, so this could be an potential reason why there is no significant improvement.

AWS Redshift typical error and potential root cause:的更多相关文章

  1. mount: error mounting /dev/root on /sysroot as ext3: Invalid argument

    /************************************************************************ * mount: error mounting /d ...

  2. [ERROR] error: error while loading <root>, error in opening zip file error: scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.

    在家编译一个Apache的开源项目,在编译时遇到错误如下: error: error while loading <root>, error in opening zip file [ER ...

  3. AWS Redshift summary

    https://blogs.aws.amazon.com/bigdata/post/Tx31034QG0G3ED1/Top-10-Performance-Tuning-Techniques-for-A ...

  4. 亚马逊的PuTTY连接AWS出现network error connection refused,终极解决方案。

    使用PuTTY连接AWS的时候,一直出现network error connection refused.百度了这个问题,大家都说是SSH要设置成22.但是我已经设置过了,为什么还是遇到这个问题呢? ...

  5. AWS EC2实例Linux系统创建root用户并更改为root用户登录

    对于刚创建AWS EC2实例,或者经常使用AWS 实例的小伙伴们来说,刚创建的EC2实例是没有ROOT权限的,因此不能直接使用ROOT用户去登陆实例,也无法获取到root权限.一般情况下,EC2实例默 ...

  6. vue error:The template root requires exactly one element.

    error:[vue/valid-template-root] The template root requires exactly one element. 原因: 因为vue的模版中只有能一个根节 ...

  7. ERROR 1130: Host 'root@localhost' is not allowed to connect to MySQL server

    连接mysql时遇到的错误. 原因:该用户没有权限连接访问mysql数据库 解决方法:网站上搜了好多,试了都没有用.最终在登陆的信息页面用root用户登陆时不输入root密码即可.

  8. aws linux主机root帐号登录

    默认情况下,aws主机必须使用pem密码文件并且以ec2-user用户登录系统,之后很多操作都必须用sudo来以root权限执行操作,显得比较麻烦. 以下来自知乎的一个问答,亲测ok ## AWS E ...

  9. ERROR 1130: Host ’...′ is not allowed to connect to this MySQL server

    /******************************************************************** * ERROR 1130: Host ’...′ is no ...

随机推荐

  1. json转数组

    - (NSDictionary *)dataArrayFromJson { NSString *filePath = [[NSBundle mainBundle] pathForResource:@& ...

  2. for循环介绍

    流程控制之for循环names=['yb','zs','yxd','lb'] i=0 while i < len(names): #4 < 4 print(names[i]) i+=1 # ...

  3. 剑指offer(14)链表中倒数第K个节点

    题目描述 输入一个链表,输出该链表中倒数第k个节点. 题目分析 用两个指针来跑,两个指针中间相距k-1个节点,第一个指针先跑,跑到了第k个节点时,第二个指针则是第一个节点. 这时候两个一起跑.当第一个 ...

  4. eclipse软件仿真操作

    1.编写程序代码(以SDRAM为例) 1.1 编写head.s汇编文件 .equ SDRAM_BASE, 0x30000000 .equ MEM_CTL_BASE, 0x48000000 .text ...

  5. svn版本备份和恢复注意事项

    转帖的,因为我经常要用到,所以也在我的博客上记录一下:  注意:备份不备份日志,你想备份日志就要单独在客户端备了,具体步骤百度上都有 svn备份常用命令1.完全备份和增量备份svn.svnadmin  ...

  6. ActiveReports 大数据分析报告:贸易争端与中国企业数字化转型

    2018年11月12日至18日,亚太经合组织(APEC)领导人非正式会议首次在南太平洋最大岛国巴布亚新几内亚的首都莫尔兹比港举行,本次会议的主题是:“把握包容性机遇,拥抱数字化未来”. 面对全球不断变 ...

  7. centos install jdk

    =========== 查询jdk版本 ===========yum search jdk =========== 安装jdk 64位开发版 ===========yum -y install jav ...

  8. hive新功能cube和rollup

    1.cube简称数据魔方,可以实现hive多个任意维度的查询,cube(a,b,c)则首先会对(a,b,c)进行group by,然后依次是(a,b),(a,c),(a),(b,c),(b),(c), ...

  9. Retrofit2

    导入项目,开启服务端 原文链接 我的Demo AndroidStudio导入会出现无法加载主类 解决办法: 1.选择自己的Jdk路径 2.运行配置,试试来回切换几次,最后选择Default就好了.再直 ...

  10. 『流畅的Python』第13章:正确重载运算符