<?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 Help on SQL Funny in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238136#M89080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are doing an upgrade on our main database moving from Progress version 10.1b to 10.2B...&lt;/P&gt;&lt;P&gt;We have a test environment set up so that we can test the system and our reports.&lt;/P&gt;&lt;P&gt;I have hit a funny which I hope someone can explain to me...&lt;/P&gt;&lt;P&gt;The attached word document shows a script that I am running.&lt;/P&gt;&lt;P&gt;This works fine in the 10.1B environment (taking about 20 seconds to run) but in the 10.2B environment it takes about 30 minutes.&lt;/P&gt;&lt;P&gt;The from section of the script looks like...&lt;/P&gt;&lt;P&gt;PUB.calendar, PUB.customer, PUB."despatch_date", PUB."invoice_detail", PUB.location, PUB.product, PUB.salesperson, PUB."sales_invoice_record", PUB."ship_method", PUB."ship_to"&lt;/P&gt;&lt;P&gt;I have found that if I move the refence to ship_method and ship_to to near the beginning of the from section i.e.&lt;/P&gt;&lt;P&gt;PUB.calendar, PUB."ship_to", PUB."ship_method", PUB.customer, PUB."despatch_date", PUB."invoice_detail", PUB.location, PUB.product, PUB."sales_invoice_record", PUB.salesperson&lt;/P&gt;&lt;P&gt;and run this against the 10.2 database, it now runs fine....i.e. takes about 20 seconds...&lt;/P&gt;&lt;P&gt;Why would this make such a difference to the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jul 2010 16:35:14 GMT</pubDate>
    <dc:creator>pkelly</dc:creator>
    <dc:date>2010-07-29T16:35:14Z</dc:date>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238136#M89080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are doing an upgrade on our main database moving from Progress version 10.1b to 10.2B...&lt;/P&gt;&lt;P&gt;We have a test environment set up so that we can test the system and our reports.&lt;/P&gt;&lt;P&gt;I have hit a funny which I hope someone can explain to me...&lt;/P&gt;&lt;P&gt;The attached word document shows a script that I am running.&lt;/P&gt;&lt;P&gt;This works fine in the 10.1B environment (taking about 20 seconds to run) but in the 10.2B environment it takes about 30 minutes.&lt;/P&gt;&lt;P&gt;The from section of the script looks like...&lt;/P&gt;&lt;P&gt;PUB.calendar, PUB.customer, PUB."despatch_date", PUB."invoice_detail", PUB.location, PUB.product, PUB.salesperson, PUB."sales_invoice_record", PUB."ship_method", PUB."ship_to"&lt;/P&gt;&lt;P&gt;I have found that if I move the refence to ship_method and ship_to to near the beginning of the from section i.e.&lt;/P&gt;&lt;P&gt;PUB.calendar, PUB."ship_to", PUB."ship_method", PUB.customer, PUB."despatch_date", PUB."invoice_detail", PUB.location, PUB.product, PUB."sales_invoice_record", PUB.salesperson&lt;/P&gt;&lt;P&gt;and run this against the 10.2 database, it now runs fine....i.e. takes about 20 seconds...&lt;/P&gt;&lt;P&gt;Why would this make such a difference to the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 16:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238136#M89080</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-07-29T16:35:14Z</dc:date>
    </item>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238137#M89081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any ideas anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 20:32:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238137#M89081</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-07-29T20:32:26Z</dc:date>
    </item>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238138#M89082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0in 0in 0pt;"&gt;Hi Paul,&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;I'm not familiar with 'Progress' but I suspect that it's not optimizing your code before it runs it. By changing the location of the table in the list in your from clause, I suspect you're changing the execution plan of the SQL query. Alterations to the execution plan can make huge differences to time to execute. (It's essentially the basis of query optimization)&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;This is one of the reasons that I no longer use the where clause join syntax. I used to have this problem regularly in Oracle. I find I have better success with optimization, and understanding the execution plans when I write explicit join clauses in the from clause, and not in the where clause. (It's also quite a bit easier to read and understand)&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;Ie:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;SELECT&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;Whatever&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;FROM&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;Table A&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;INNER JOIN Table B ON TableA.ID - TableB.ID&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;INNER JOIN (etc)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 01:06:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238138#M89082</guid>
      <dc:creator />
      <dc:date>2010-07-30T01:06:17Z</dc:date>
    </item>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238139#M89083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ryan...I will give it a go....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 07:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238139#M89083</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-07-30T07:46:16Z</dc:date>
    </item>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238140#M89084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan&lt;/P&gt;&lt;P&gt;I amended my query as per your suggestion...&lt;/P&gt;&lt;P&gt;This works fine with 10.1B (about 20 seconds) but with the new updated software (10.2B) it is taking ages to run....&lt;/P&gt;&lt;P&gt;Tried moving the inner join statements about as I did with the From Tables - no success...&lt;/P&gt;&lt;P&gt;This really is weird...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 08:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238140#M89084</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-07-30T08:13:28Z</dc:date>
    </item>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238141#M89085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Ryan. I have no knowledge about Progress, but I know that some db:s are very sensitive to the query matching the indexes available. If it can't find an exact matching index the db will perform a table scan instead, which could be very time consuming.&lt;/P&gt;&lt;P&gt;I recall working with AS/400 years ago, and if you for example had an index on a table covering field A, B, C, but only used A and B in your query the index wasn't used. By including the field C in the query (even though not making any filtering on the field) so the query exactly matched the index you could see that the index was used, hence a huge performance boost.&lt;/P&gt;&lt;P&gt;It could also be that you need to rebuild your indexes, or other issues related to the upgrade. I suggest you turn the question to your Progress consultant which can help you out tuning the db for you, if you're not lucky finding a Progress expert here on the forum &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 11:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238141#M89085</guid>
      <dc:creator>Bjorn_Wedbratt</dc:creator>
      <dc:date>2010-07-30T11:03:16Z</dc:date>
    </item>
    <item>
      <title>Help on SQL Funny</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238142#M89086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bjorn and Ryan....&lt;/P&gt;&lt;P&gt;Agree, think we will have to go back to our software house.&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 22:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-SQL-Funny/m-p/238142#M89086</guid>
      <dc:creator>pkelly</dc:creator>
      <dc:date>2010-07-30T22:01:48Z</dc:date>
    </item>
  </channel>
</rss>

