<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Comic Sans MS";
        panose-1:3 15 7 2 3 3 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Comic Sans MS";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Comic Sans MS&quot;">That is my recollection as well.&nbsp; I&#8217;ve always believed that SELECT IF would minimise i/o by reducing the number of record complexes that would be created. I *<b>think</b>* I read
 it in an old PH manual back in the day&#8230;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Comic Sans MS&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> powerh-l-bounces&#43;chan=camosun.bc.ca@lists.sowder.com [mailto:powerh-l-bounces&#43;chan=camosun.bc.ca@lists.sowder.com]
<b>On Behalf Of </b>Herald.Kaffka@westfraser.com<br>
<b>Sent:</b> Wednesday, 25 September, 2013 06:52<br>
<b>To:</b> powerh-l@lists.sowder.com<br>
<b>Subject:</b> Re: QTP reads every row instead of using index?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">(Had to trim most of the history, size of this message thread of was getting too big for this list...).</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">========================================================================</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">I also seem to remember something about &quot;select file if&quot; conditions short circuiting the build of a record complex,</span>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">(Select File if was supposed to kick in as soon as the file entered the record complex, and would prevent PH from</span>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">growing the record complex with unneeded records, while select &nbsp;was evaluated &quot;after all records were retreived&quot;).</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Don't know if &nbsp;this is an urban legend, an relic of an early PH version, or if there some truth to it...</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">To this day, (If I'm not working with a cursor), I still tend to
</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">&quot;Choose&quot; on the primary file,
</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">select file if as soon as possible on the other files in the access list (esp if selecting on some field condition in just that file such as &quot;select inventory_balance if status of inventory_balance
 = &quot;A&quot;).</span> <br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">and run a final select on cross table fields at the bottom. &nbsp;
</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Don't know if really more efficient or not (at one time I was told it was), &nbsp;but it does tend to make the logic on a large ugly join a little clearer (at least to me).</span>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">I'm not likely to change my style at this point, but I do idly wonder if &quot;I'm right&quot; or if it's just a &quot;Crusty Old Guy&quot; thing...
</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">(Or if the answer is like all good fairy tales and begins &quot;once upon a time&quot; this was correct, but after version x it doesn't matter any more...).</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">===========================================================================</span>
<br>
<br>
<br>
Thanks! <br>
<br>
A&#43; <br>
<br>
Etienne <br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">============================================================================</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Think first, reply later. &nbsp;(gotta remember that rule).</span>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
There is/was an advantage to using Choose (or choose with select) on RMS/ISAM.</span>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
The choose (which can only operate on the initial file on the access statement), can limit the size of the data set which
<br>
is processed. &nbsp;(You have to be choosing an indexed item, only items which match the choose criteria are driven down</span>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
into the link x of table a to y of table b logic). &nbsp;With just a select, all of table A will be read, POWERHOUSE will apply the</span>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
select, and then use that to drive out the the other tables in the Join. &nbsp;If table A is very big, and the select is very selective,</span>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
this can be a big difference, (read a million records, throw out the ones before yesterday, link the remaining 2000 records</span>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
into a results set, as opposed to reading 2000 rows since yesterday (choose date(days(sysdate)-1)) and building the complex...</span>
<br>
<br>
<br>
<br>
<br>
---------------------------- <br>
This e-mail message and any attachments are confidential. Any dissemination or use of this information by a person other than the intended recipient is unauthorized. If you are not the intended recipient, please notify me by return e-mail, do not open any attachment
 and delete this communication and any copy. Thank you <o:p></o:p></p>
</div>
</body>
</html>