<?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>Question Re: SQL Query Where Clause condition Magic in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-query-where-clause-condition-magic/qaa-p/447132#M66520</link>
    <description>&lt;P&gt;As with most "Why is my SQL fast/slow?" questions your first step of analysis should be to review what's happening on DB level.&lt;/P&gt;
  &lt;P&gt;Capture the SQL and run an EXPLAIN PLAN against both variants. That should provide a first idea on where the difference is in the execution of both statements.&lt;/P&gt;
  &lt;P&gt;Also, since you're selecting from a (complex) view, you might want to review the view design for possible bottlenecks. E.g. if there is a large join before the months-restriction gets applied that could be a cause.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2017 23:54:57 GMT</pubDate>
    <dc:creator>lbreddemann</dc:creator>
    <dc:date>2017-07-20T23:54:57Z</dc:date>
    <item>
      <title>SQL Query Where Clause condition Magic</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-where-clause-condition-magic/qaq-p/447131</link>
      <description>&lt;P&gt;Hi All, &lt;/P&gt;
  &lt;P&gt;We had performance issue in HANA SP12 1.22 where this query that had where clasue like CalMonth le 12 was taking 140 seconds. Soon we changed query where clasue to (CalMonth ge 1 and Calmonth Le 12 ), query responded in 2.8 seconds. I am attaching two screenshot highlighting where clasue and performance improvement. &lt;/P&gt;
  &lt;P&gt;I would like to take your insight why this made such huge performance improvement.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/56449-140-seconds-with-calmonth-le-12.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/56450-2-seconds-with-calmonth-ge-1-and-calmonth-le-12.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 19:52:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-where-clause-condition-magic/qaq-p/447131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-07-20T19:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Where Clause condition Magic</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-where-clause-condition-magic/qaa-p/447132#M66520</link>
      <description>&lt;P&gt;As with most "Why is my SQL fast/slow?" questions your first step of analysis should be to review what's happening on DB level.&lt;/P&gt;
  &lt;P&gt;Capture the SQL and run an EXPLAIN PLAN against both variants. That should provide a first idea on where the difference is in the execution of both statements.&lt;/P&gt;
  &lt;P&gt;Also, since you're selecting from a (complex) view, you might want to review the view design for possible bottlenecks. E.g. if there is a large join before the months-restriction gets applied that could be a cause.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 23:54:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-where-clause-condition-magic/qaa-p/447132#M66520</guid>
      <dc:creator>lbreddemann</dc:creator>
      <dc:date>2017-07-20T23:54:57Z</dc:date>
    </item>
  </channel>
</rss>

