 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: iSeries RPG Embedded SQL Performance</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 17:28:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57783</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Fri, 14 Nov 2008 22:23:18 +0000</pubDate>
		<guid isPermaLink="false">#comment-57783</guid>
		<description><![CDATA[When you create a logical file or a view, you specify the same stuff, columns, order, omit/select rules.  
It&#039;s easy to think of a view as an SQL logical but it&#039;s not.

The logical file contains the index used to find the data, it taks a significant amount of space, it requires updates when data is added, changed or deleted.  

The view contains the set of rules to get the data, no index, no map, nothing that will really speed up the system .. except that on the SQL engine will be used.

Want speed use the physical or view but build the indexes.]]></description>
		<content:encoded><![CDATA[<p>When you create a logical file or a view, you specify the same stuff, columns, order, omit/select rules.<br />
It&#8217;s easy to think of a view as an SQL logical but it&#8217;s not.</p>
<p>The logical file contains the index used to find the data, it taks a significant amount of space, it requires updates when data is added, changed or deleted.  </p>
<p>The view contains the set of rules to get the data, no index, no map, nothing that will really speed up the system .. except that on the SQL engine will be used.</p>
<p>Want speed use the physical or view but build the indexes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57782</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Fri, 14 Nov 2008 21:38:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-57782</guid>
		<description><![CDATA[Yes  use Physical files or views for the files queried in the SQL, not logical files.  
I think you want to create indexes over the files for the key fields.
But I think that the use of the subselect in the SQL will make the biggest difference.]]></description>
		<content:encoded><![CDATA[<p>Yes  use Physical files or views for the files queried in the SQL, not logical files.<br />
I think you want to create indexes over the files for the key fields.<br />
But I think that the use of the subselect in the SQL will make the biggest difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sloopy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57774</link>
		<dc:creator>sloopy</dc:creator>
		<pubDate>Fri, 14 Nov 2008 16:19:43 +0000</pubDate>
		<guid isPermaLink="false">#comment-57774</guid>
		<description><![CDATA[Oh, WHY is this editor not showing the link I inserted??

Look here:

http://www.itjungle.com/fhg/fhg040908-story01.html

:-~]]></description>
		<content:encoded><![CDATA[<p>Oh, WHY is this editor not showing the link I inserted??</p>
<p>Look here:</p>
<p><a href="http://www.itjungle.com/fhg/fhg040908-story01.html" rel="nofollow">http://www.itjungle.com/fhg/fhg040908-story01.html</a></p>
<p>:-~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: graybeard52</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57773</link>
		<dc:creator>graybeard52</dc:creator>
		<pubDate>Fri, 14 Nov 2008 16:19:41 +0000</pubDate>
		<guid isPermaLink="false">#comment-57773</guid>
		<description><![CDATA[You need to make sure this query gets run thru the newer SQE engine and not CQE.  While performance is very much system and file dependent, I found about 400% improvement.  Here&#039;s some other things that might help.
(1) Check file QUSRSYS/QAQQINI file.  Make certain &quot;Ignore derived indexes&quot; option is set to *YES (default is *NO)
(2) As suggested, building indexes is very important.  If you have V5R4 or better, run the query through Visual Explain and build the suggested indexes.
(3) Create a seperate memory pool for SQL requests and set the minimum and maximum sizes identical.  This prevents performance tuning from shriking the available memory while the query is running.  This step alone helped me bring a 27 hour query down to 1 hour.]]></description>
		<content:encoded><![CDATA[<p>You need to make sure this query gets run thru the newer SQE engine and not CQE.  While performance is very much system and file dependent, I found about 400% improvement.  Here&#8217;s some other things that might help.<br />
(1) Check file QUSRSYS/QAQQINI file.  Make certain &#8220;Ignore derived indexes&#8221; option is set to *YES (default is *NO)<br />
(2) As suggested, building indexes is very important.  If you have V5R4 or better, run the query through Visual Explain and build the suggested indexes.<br />
(3) Create a seperate memory pool for SQL requests and set the minimum and maximum sizes identical.  This prevents performance tuning from shriking the available memory while the query is running.  This step alone helped me bring a 27 hour query down to 1 hour.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sloopy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57772</link>
		<dc:creator>sloopy</dc:creator>
		<pubDate>Fri, 14 Nov 2008 16:18:49 +0000</pubDate>
		<guid isPermaLink="false">#comment-57772</guid>
		<description><![CDATA[Biggest speed-up tip - DON&#039;T use DDS-defined logical files!

See here for a full explanation:

&lt;a href=&quot;http://www.itjungle.com/fhg/fhg040908-story01.html&quot;&gt;&lt;/a&gt;

The link also shows what you have to do to stop SQL using logical files by default.

Instead, you should create SQL Views. Vatchy is correct that you should create the intermediate file which SQL creates - but that is not an iSeries, DB/400 logical file, it&#039;s an SQL View.

The major overhead on your SQL looks like the date and check code selection. Making those the major keys in your view may make a considerable difference to the processing time.

Regards,

Sloopy]]></description>
		<content:encoded><![CDATA[<p>Biggest speed-up tip &#8211; DON&#8217;T use DDS-defined logical files!</p>
<p>See here for a full explanation:</p>
<p><a href="http://www.itjungle.com/fhg/fhg040908-story01.html"></a></p>
<p>The link also shows what you have to do to stop SQL using logical files by default.</p>
<p>Instead, you should create SQL Views. Vatchy is correct that you should create the intermediate file which SQL creates &#8211; but that is not an iSeries, DB/400 logical file, it&#8217;s an SQL View.</p>
<p>The major overhead on your SQL looks like the date and check code selection. Making those the major keys in your view may make a considerable difference to the processing time.</p>
<p>Regards,</p>
<p>Sloopy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vatchy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57751</link>
		<dc:creator>vatchy</dc:creator>
		<pubDate>Thu, 13 Nov 2008 18:57:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-57751</guid>
		<description><![CDATA[The easiest method I&#039;ve found to speed up SQL and queries is to create the logical file that the SQL is creating - permanently.  If you only run this once per month or so you might not want the additional access path on your system but if you run if every day or every week then (IMHO) it is definitely worth it.]]></description>
		<content:encoded><![CDATA[<p>The easiest method I&#8217;ve found to speed up SQL and queries is to create the logical file that the SQL is creating &#8211; permanently.  If you only run this once per month or so you might not want the additional access path on your system but if you run if every day or every week then (IMHO) it is definitely worth it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/iseries-rpg-embedded-sql-performance/#comment-57728</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Wed, 12 Nov 2008 15:33:44 +0000</pubDate>
		<guid isPermaLink="false">#comment-57728</guid>
		<description><![CDATA[Martin
Your join is doing what Query does - joining the entire files and then discarding 
bad joins.  This is speeded up with subselects.  So the number of records joined and then
discarded is reduced.   Assuming that both of your restrictions are on FILE2 the improvided 
query would look like this.  Much like other types of programming SQL does the stuff in ( ) first 
so it builds a temp file of the qualifing records from File2 and then joins those to all the records
in File1.  Both joined files might be handled in subselects if you have where clauses on both.



SELECT         ALL 
FILE01_A, FILE02_B,    
SUBSTR(DIGITS(DATE_FIELD),4,2) AS MONTH,          
FILE02_C, FILE01_D, FILE01_E, FILE01_F       

FROM  FILE01 join 
   ( Select * from File2 where DATE_FIELD &gt;= 1080101  AND  CHECK_CODE &lt;&gt; &#039;AB&#039;) 
  on FILE01_KEY01 = FILE02_KEY01    AND  FILE01_KEY02 = FILE02_KEY02]]></description>
		<content:encoded><![CDATA[<p>Martin<br />
Your join is doing what Query does &#8211; joining the entire files and then discarding<br />
bad joins.  This is speeded up with subselects.  So the number of records joined and then<br />
discarded is reduced.   Assuming that both of your restrictions are on FILE2 the improvided<br />
query would look like this.  Much like other types of programming SQL does the stuff in ( ) first<br />
so it builds a temp file of the qualifing records from File2 and then joins those to all the records<br />
in File1.  Both joined files might be handled in subselects if you have where clauses on both.</p>
<p>SELECT         ALL<br />
FILE01_A, FILE02_B,<br />
SUBSTR(DIGITS(DATE_FIELD),4,2) AS MONTH,<br />
FILE02_C, FILE01_D, FILE01_E, FILE01_F       </p>
<p>FROM  FILE01 join<br />
   ( Select * from File2 where DATE_FIELD &gt;= 1080101  AND  CHECK_CODE &lt;&gt; &#8216;AB&#8217;)<br />
  on FILE01_KEY01 = FILE02_KEY01    AND  FILE01_KEY02 = FILE02_KEY02</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.014 seconds using memcached
Object Caching 352/355 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 19:56:48 -->