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. Dockerfile构建容器---构建本地tomcat

    前序 这是我第一次摸索.做个笔记记录一下. 首先准备好tomcat与jdk解压到与Dockerfile同级的目录下, 构建文件命名必须为Dockerfile, 为什么同级, 因为build的时候会默认 ...

  2. python版 mapreduce 矩阵相乘

    参考张老师的mapreduce 矩阵相乘. 转载请注明:来自chybot的学习笔记http://i.cnblogs.com/EditPosts.aspx?postid=4541939 下面是我用pyt ...

  3. U3D外包团队—技术分享 U3d中获得物体的size

    以size的x方向为例 1:gameObject.renderer.bounds.size.x;//这个值的结果真实反应出有MeshRenderer这个组件的模型的尺寸.不需要再乘以localScal ...

  4. 关于input输入框内设置小图标的问题

    其实很简单,只需要html和css就可以搞定啦 首先:<input class="layui-input" id="test1" placeholder= ...

  5. linux基础11-bash编程(字符串测试 和 for循环)

    练习:传递一个用户名参数给脚本,判断此用户的用户名跟其基本组的组名是否一致,并将结果显示出来.(1)字符测试:==:测试是否相等,相等为真,不等为假!=: 测试是否不等,不等为真,等为假>< ...

  6. QGis+QT5.9+VS2017源码编译

    1.需要软件 VS2017 QT5.9.2 CMake 3.10.2 Cygwin osgeo4w QGIS源码 2.安装VS2017  过程省略 是由于机器上已经安装了VS2017 3.安装QT5. ...

  7. css及HTML知识点

    html : 180°  输出为 css:    margin: 0 auto;会在页面水平居中显示  box-shadow: 0 0 5px #f61818; 设置投影的位置大小颜色 outline ...

  8. Ubuntu环境下,项目出现:Call to undefined function curl_init() 提示

    原因: 没有开启curl扩展 安装或者开启扩展 ubuntu 执行安装Curl的扩展 sudo apt-get install -y php-curl 同: mysql,redis,curl,等. 摘 ...

  9. 『TensorFlow』网络操作API_下

    一.优化器基类介绍 标注一点,优化器中的学习率可以是tensor,这意味着它可以feed, learning_rate: A Tensor or a floating point value. 正常使 ...

  10. jQuery 省份选择

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...