<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why is SUM in load script so slow? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367925#M492054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the answer is that you are processing many more than 1.2M&amp;nbsp; rows in the sum. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table OOO starts with 1.2M rows. Then you join the Rooms table onto OOO. Assuming 100 rooms per property, table OOO now has 120M rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sum and group by is therefore taking in 120M rows. The 1.2M reported in the log is the grouped by count, not the input row count. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the timing may not be all that unreasonable. Hard to say without knowing the actual count of OOO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure why a sum() on a resident table is using only a single core. That may be an additional question once you confirm if my explanation makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2012 05:02:33 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2012-08-10T05:02:33Z</dc:date>
    <item>
      <title>Why is SUM in load script so slow?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367920#M492049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a load script where I am loading a table with ~1M rows.&lt;/P&gt;&lt;P&gt;The next thing I do is reload it (resident load) as a different table and do a SUM on one of the fields (group by two other fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Table2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; Field1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; Field2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; Sum(Metric) AS SumOfMetric&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Resident Table1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Group By&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; Field1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; Field2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It takes a very long time to run (&amp;gt;20 minutes), which is surprising since the original 1Mrow table loaded in a few seconds.&lt;/P&gt;&lt;P&gt;I have a server with 16 cores, but only one core is being used at any given time during the SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea why this is so slow or how I can speed it up?&lt;/P&gt;&lt;P&gt;The same operation in a chart in the UI is super fast!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 19:50:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367920#M492049</guid>
      <dc:creator />
      <dc:date>2012-07-25T19:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why is SUM in load script so slow?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367921#M492050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you get any response for solving your problem?&lt;/P&gt;&lt;P&gt;I got the same issue and don't know how to solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Ramon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Aug 2012 19:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367921#M492050</guid>
      <dc:creator />
      <dc:date>2012-08-05T19:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why is SUM in load script so slow?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367922#M492051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Ramon,&lt;/P&gt;&lt;P&gt;No, I have not gotten any response. I am just trying to do all of my data transformation &amp;amp; aggregation in my SQL scripts, prior to loading it into QVDs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know why QlikView is so much slower than a database engine when doing simple aggregations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 15:32:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367922#M492051</guid>
      <dc:creator />
      <dc:date>2012-08-06T15:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is SUM in load script so slow?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367923#M492052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is surprising. Can you post the logfile where it runs slow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 15:43:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367923#M492052</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-08-06T15:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is SUM in load script so slow?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367924#M492053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rob,&lt;/P&gt;&lt;P&gt;Thanks for taking a look. Please see attached log file.&lt;/P&gt;&lt;P&gt;The delay happens right at the end, around 3:49 in the log. It take ~8 minutes to calculate a SUM on 1.2 million rows, grouping by 2 other fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Simon-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 17:48:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367924#M492053</guid>
      <dc:creator />
      <dc:date>2012-08-09T17:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why is SUM in load script so slow?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367925#M492054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the answer is that you are processing many more than 1.2M&amp;nbsp; rows in the sum. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table OOO starts with 1.2M rows. Then you join the Rooms table onto OOO. Assuming 100 rooms per property, table OOO now has 120M rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sum and group by is therefore taking in 120M rows. The 1.2M reported in the log is the grouped by count, not the input row count. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the timing may not be all that unreasonable. Hard to say without knowing the actual count of OOO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure why a sum() on a resident table is using only a single core. That may be an additional question once you confirm if my explanation makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 05:02:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-is-SUM-in-load-script-so-slow/m-p/367925#M492054</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-08-10T05:02:33Z</dc:date>
    </item>
  </channel>
</rss>

