<?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 Slowly building a QVD to avoid SQL server performance degredation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392607#M701791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My application uses QVD's to store an audit trail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is that on the &lt;STRONG&gt;first &lt;/STRONG&gt;load, the SQL query will often cause the SQL server to grind to a halt in production. In the dev environment with less records, this isn't an issue. &lt;/P&gt;&lt;P&gt;Once the QVD is built, then the subsequent loads will only add to the QVD what has changed, which is all good. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So one option is to use the SELECT TOP X records to load only the first say 10,000 records at a time. These records are then written to the QVD and the record counter is updated, so on the next reload, the next X records are loaded. &lt;/P&gt;&lt;P&gt;This works OK, but I would need to ask my user to keep hitting the reload command.&lt;/P&gt;&lt;P&gt;(the second option is to rewrite the SQL query and use temporary tables etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do this in a For Loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would need is to have is a variable which will tell me how many records have been returned by the query.&lt;/P&gt;&lt;P&gt;I have tried the &lt;/P&gt;&lt;P&gt;load field, count(field) as &lt;EM&gt;NumberOfRecordsLoaded&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Resident Table&lt;/P&gt;&lt;P&gt;Group by field;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that doesn't seem to work, as the &lt;EM&gt;NumberOfRecordsLoaded &lt;/EM&gt;doesn't seem to get a value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone done something similar to this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Oct 2012 07:23:25 GMT</pubDate>
    <dc:creator>johnpaul</dc:creator>
    <dc:date>2012-10-09T07:23:25Z</dc:date>
    <item>
      <title>Slowly building a QVD to avoid SQL server performance degredation</title>
      <link>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392607#M701791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My application uses QVD's to store an audit trail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is that on the &lt;STRONG&gt;first &lt;/STRONG&gt;load, the SQL query will often cause the SQL server to grind to a halt in production. In the dev environment with less records, this isn't an issue. &lt;/P&gt;&lt;P&gt;Once the QVD is built, then the subsequent loads will only add to the QVD what has changed, which is all good. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So one option is to use the SELECT TOP X records to load only the first say 10,000 records at a time. These records are then written to the QVD and the record counter is updated, so on the next reload, the next X records are loaded. &lt;/P&gt;&lt;P&gt;This works OK, but I would need to ask my user to keep hitting the reload command.&lt;/P&gt;&lt;P&gt;(the second option is to rewrite the SQL query and use temporary tables etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do this in a For Loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would need is to have is a variable which will tell me how many records have been returned by the query.&lt;/P&gt;&lt;P&gt;I have tried the &lt;/P&gt;&lt;P&gt;load field, count(field) as &lt;EM&gt;NumberOfRecordsLoaded&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Resident Table&lt;/P&gt;&lt;P&gt;Group by field;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that doesn't seem to work, as the &lt;EM&gt;NumberOfRecordsLoaded &lt;/EM&gt;doesn't seem to get a value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone done something similar to this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2012 07:23:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392607#M701791</guid>
      <dc:creator>johnpaul</dc:creator>
      <dc:date>2012-10-09T07:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Slowly building a QVD to avoid SQL server performance degredation</title>
      <link>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392608#M701792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, John&lt;/P&gt;&lt;P&gt;Instead&amp;nbsp; of &lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;load field, count(field) as &lt;EM&gt;NumberOfRecordsLoaded&lt;/EM&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Resident Table&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Group by field;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;you could try this:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;let nRows = NoOfRows('Table') ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe your load would be like this: &lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;load count(field) as &lt;EM&gt;NumberOfRecordsLoaded&lt;/EM&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Resident Table;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;nRows = peek('&lt;EM style="color: #737373; font-family: Arial;"&gt;NumberOfRecordsLoaded&lt;/EM&gt;');&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;drop table Temp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;If you write you for... loop, between steps you could add some sleep time to give some time and avoid using all database resources. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Hope this helps &lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 03:50:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392608#M701792</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2012-10-10T03:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Slowly building a QVD to avoid SQL server performance degredation</title>
      <link>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392609#M701793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That worked OK.&lt;/P&gt;&lt;P&gt;The method I used was the following one:&lt;/P&gt;&lt;P&gt; &lt;SPAN style="color: #737373; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;let nRows = NoOfRows('Table') ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 09:37:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Slowly-building-a-QVD-to-avoid-SQL-server-performance/m-p/392609#M701793</guid>
      <dc:creator>johnpaul</dc:creator>
      <dc:date>2012-10-10T09:37:34Z</dc:date>
    </item>
  </channel>
</rss>

