{"id":188,"date":"2012-05-04T05:24:00","date_gmt":"2012-05-04T05:24:00","guid":{"rendered":"https:\/\/www.shaopin.link\/wordpress\/index.php\/2012\/05\/04\/system-i-sql-coalesce-function-in-views-has-a-deficiency\/"},"modified":"2012-05-04T05:24:00","modified_gmt":"2012-05-04T05:24:00","slug":"system-i-sql-coalesce-function-in-views-has-a-deficiency","status":"publish","type":"post","link":"https:\/\/www.shaopin.link\/wordpress\/index.php\/system-i-sql-coalesce-function-in-views-has-a-deficiency\/","title":{"rendered":"System i &#8211; SQL COALESCE function in views has a deficiency"},"content":{"rendered":"<p><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">I was upgrade V5R3 &#8211;&gt; V6R1 in last month,<\/span><br \/><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">\u6211\u5011\u8e29\u5230 IBM SQE \u7684 Bug, \u958bPMR\u5f04\u4e86\u4e00\u500b\u6708,\u624d\u7531\u516c\u53f8\u540c\u4e8b\u627e\u5230\u554f\u984c.<\/span><\/p>\n<p><span lang=\"en\"><span><\/span><span><\/span><\/span><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\"><\/span><\/p>\n<p><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">There isn&#8217;t a problem specifically with the COALESCE function,<\/span><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\"> <\/span><br \/><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">&nbsp;But use <b><span style=\"color: red;\">COALESCE<\/span><\/b> on columns in <b style=\"color: red;\">Views<\/b>&nbsp;<b>  then used to<span style=\"color: red;\"> join to a table <\/span>in a query<\/b>, will cause SQL performance proble.<\/span><\/p>\n<p><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">This SQE&nbsp; deficiency should be fixed,<\/span><br \/><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">rewritting those views can resolve the performance problem .&nbsp;<\/span><\/p>\n<p><span lang=\"EN-US\" style=\"font-family: &quot;\u65b0\u7d30\u660e\u9ad4&quot;,&quot;serif&quot;; font-size: 12pt;\">Query the SYSVIEWS table to determine if they have other views which use COALESCE, <br \/>i.e.: <\/p>\n<p>select system_view_schema, <br \/>system_view_name , view_definition <br \/>from qsys2\/sysviews <br \/>where upper(view_definition) like &#8216;%COALESCE%&#8217; <br style=\"mso-special-character: line-break;\" \/><br style=\"mso-special-character: line-break;\" \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was upgrade V5R3 &#038; &hellip; <a href=\"https:\/\/www.shaopin.link\/wordpress\/index.php\/system-i-sql-coalesce-function-in-views-has-a-deficiency\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">System i &#8211; SQL COALESCE function in views has a deficiency<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-as400"],"_links":{"self":[{"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":0,"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shaopin.link\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}