<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:"Comic Sans MS"">That is my recollection as well. I’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…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Comic Sans MS""><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> powerh-l-bounces+chan=camosun.bc.ca@lists.sowder.com [mailto:powerh-l-bounces+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> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">(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:"Arial","sans-serif"">========================================================================</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">I also seem to remember something about "select file if" conditions short circuiting the build of a record complex,</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">(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:"Arial","sans-serif"">growing the record complex with unneeded records, while select was evaluated "after all records were retreived").</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Don't know if 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:"Arial","sans-serif"">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:"Arial","sans-serif"">"Choose" on the primary file,
</span><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">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 "select inventory_balance if status of inventory_balance
= "A").</span> <br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">and run a final select on cross table fields at the bottom.
</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Don't know if really more efficient or not (at one time I was told it was), 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:"Arial","sans-serif"">I'm not likely to change my style at this point, but I do idly wonder if "I'm right" or if it's just a "Crusty Old Guy" thing...
</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">(Or if the answer is like all good fairy tales and begins "once upon a time" this was correct, but after version x it doesn't matter any more...).</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">===========================================================================</span>
<br>
<br>
<br>
Thanks! <br>
<br>
A+ <br>
<br>
Etienne <br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">============================================================================</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Think first, reply later. (gotta remember that rule).</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><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:"Arial","sans-serif""><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. (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:"Arial","sans-serif""><br>
into the link x of table a to y of table b logic). With just a select, all of table A will be read, POWERHOUSE will apply the</span>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
select, and then use that to drive out the the other tables in the Join. If table A is very big, and the select is very selective,</span>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><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:"Arial","sans-serif""><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>