<?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 Eploding memory when creating summary table.  Why? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250400#M710304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not seeing the cause of the problem.&amp;nbsp; You might need a noconcatenate when loading the summary table if it has the same fields as the detail table.&amp;nbsp; In that case, QlikView would concatenate them together, and then when you drop detail, drop the whole thing.&amp;nbsp; But I don't see how that would cause a performance problem, just a results problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jul 2011 22:51:38 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-07-01T22:51:38Z</dc:date>
    <item>
      <title>Eploding memory when creating summary table.  Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250399#M710303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a load script that is attempting to create a summary table from detailed data.&amp;nbsp;&amp;nbsp; The memory usage seems to explode exponentially, (and gets excessive above 1 million rows), but there is only one resultant table (i.e. no joins causing cartesian products).&amp;nbsp;&amp;nbsp; Anyone have any ideas why this is the case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the basic script (many of the numeric column have been removed to abbreviate the script):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Detail:&lt;BR /&gt;First 500000&lt;BR /&gt;LOAD Item_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Costs,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; &lt;BR /&gt;42 more measures&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;BR /&gt;FROM [2011 Sales Weekly.qvd] (qvd);&lt;/P&gt;&lt;P&gt;inner join&lt;BR /&gt;LOAD Time_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Year, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_PP, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Period&lt;BR /&gt;FROM [Dim Time.qvd] (qvd)&lt;BR /&gt;where exists( Time_Key );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Inner Join &lt;BR /&gt;LOAD Item_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vendor_Key&lt;BR /&gt;FROM [Dim Item.qvd] (qvd)&lt;BR /&gt;where exists( Item_Key );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Summary:&lt;BR /&gt;Load Item_Key as Item_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store_Key as Store_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vendor_Key as Vendor_Key,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Year as Billing_Year,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_PP as Billing_PP, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Period as Billing_Period,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum( Sales ) as Sales, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum( Costs ) as Costs, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; &lt;BR /&gt;42 more measures&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;BR /&gt;Resident Detail&lt;BR /&gt;Group By Item_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store_Key, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vendor_Key,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Year,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_PP, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Period;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Drop Table Detail;&lt;/P&gt;&lt;P&gt;STORE Summary into [2011 Sales By Period.qvd] (qvd);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 19:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250399#M710303</guid>
      <dc:creator />
      <dc:date>2011-07-01T19:51:37Z</dc:date>
    </item>
    <item>
      <title>Eploding memory when creating summary table.  Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250400#M710304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not seeing the cause of the problem.&amp;nbsp; You might need a noconcatenate when loading the summary table if it has the same fields as the detail table.&amp;nbsp; In that case, QlikView would concatenate them together, and then when you drop detail, drop the whole thing.&amp;nbsp; But I don't see how that would cause a performance problem, just a results problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 22:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250400#M710304</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-01T22:51:38Z</dc:date>
    </item>
    <item>
      <title>Eploding memory when creating summary table.  Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250401#M710305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What was even more strange is that when I removed the Exists clause on the joined tables, it would return a cartesian product, which makes no sense given that it is an inner join to begin with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a while there, I was having all kinds of problems in that I set the First command to 10 and it still would blow up memory.&amp;nbsp;&amp;nbsp; Really strange...I am wondering if the number of columns that I am summing is causing QV to lose it's head.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 22:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250401#M710305</guid>
      <dc:creator />
      <dc:date>2011-07-01T22:56:56Z</dc:date>
    </item>
    <item>
      <title>Eploding memory when creating summary table.  Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250402#M710306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One other thing I do differently, in case it matters - I always explicitly specify which table I'm joining to rather than letting QlikView figure it out for me.&amp;nbsp; I want to KNOW that I'm joining to the table I intended, not just hope.&amp;nbsp; So I'd be saying INNER JOIN (Detail) everywhere.&amp;nbsp; I can't think how that would make any difference, though, as the table to inner join to seems obvious (it is, after all, the only table that exists).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;50 or so columns isn't a lot of columns, so I can't imagine that's the problem either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 23:09:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250402#M710306</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-01T23:09:03Z</dc:date>
    </item>
    <item>
      <title>Eploding memory when creating summary table.  Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250403#M710307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&amp;nbsp; As it turns out, it seems that there is something going on in the way QV handles Group Bys.&amp;nbsp;&amp;nbsp; As I add more columns with which to calculate a sum on, it adds a tremendous amount of memory overhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grouping 11 million rows over 8 key fields down to 8,245,570 records I see the following pattern:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summing 2 Metrics:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.783GB&lt;/P&gt;&lt;P&gt;Summing 3 Metrics:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.133GB &lt;/P&gt;&lt;P&gt;Summing 4 Metrics:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.004GB&lt;/P&gt;&lt;P&gt;Summing 5 Metrics:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.372GB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With a caveat on the last one because I was running low on memory.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, you can see that each incremental metric adds a tremendous amount of memory.&amp;nbsp;&amp;nbsp; Once the operation is complete, however, it quiesces down to 429mb (with 5 metrics).&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the 42 metrics that I need to add, it would take approximately 22GB of RAM just to create a summary table, and no telling what would happen as I add the remaining detail records, which will be probably another 20million rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any other ideas for creating summary tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Jul 2011 16:44:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250403#M710307</guid>
      <dc:creator />
      <dc:date>2011-07-02T16:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Eploding memory when creating summary table.  Why?</title>
      <link>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250404#M710308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow.&amp;nbsp; Either something strange is going on, or QlikView is using a very memory-inefficient algorithm.&amp;nbsp; Not that QlikView would work strictly procedurally on the problem, but I'd have expected something like sorting the data by your group by fields, then going down the list summing up.&amp;nbsp; It could just sort pointers to the original table, and then drop the pointers as it builds your summary records.&amp;nbsp; It doesn't seem like it should take much memory at all.&amp;nbsp; Maybe there was some memory vs. performance trade off they made, since what I mention would only be moderate performance?&amp;nbsp; Still...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd get in touch with QlikTech.&amp;nbsp; That just doesn't seem right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To work around it if you can't wait to hear back from them, you could do the sums yourself.&amp;nbsp; There's probably a more efficient way, but something like this maybe:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN (Detail)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD key fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,if(key1&amp;lt;&amp;gt;previous(key1) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;or key2&amp;lt;&amp;gt;previous(key2) etc.,1) as StartFlag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Detail&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ORDER BY key fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN (Detail)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD key fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,previous(StartFlag) as EndFlag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Detail&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ORDER BY key fields descending&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Summary:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NOCONCATENATE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;key fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,EndFlag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,Sales + if(StartFlag,0,peek(Sales)) as Sales&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,Cost&amp;nbsp; + if(StartFlag,0,peek(Cost))&amp;nbsp; as Cost&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Detail&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN (Summary)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD 1 as EndFlag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE Detail;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP FIELD EndFlag;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jul 2011 16:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Eploding-memory-when-creating-summary-table-Why/m-p/250404#M710308</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-05T16:49:08Z</dc:date>
    </item>
  </channel>
</rss>

