<?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: SQL query performance issue in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/267161#M58006</link>
    <description>&lt;P&gt;Yeah. It is Oracle DBA job. You can query Meta Data(Dictionary table) to get the number of records of a Oracle Table.&lt;/P&gt;
&lt;P&gt;Ask&amp;nbsp;&lt;SPAN&gt;Oracle DBA how to write this kind of Oracle SQL statement, and Pass - through it by SAS Proc sql .&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2016 03:50:58 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-04-29T03:50:58Z</dc:date>
    <item>
      <title>SQL query performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/266936#M57978</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having a PROC SQL statement which select count(*) from an Oracle table. The table is having huge number of records. Is there any options/statements or any other way with which I can optimize the query to yield the result much faster.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 13:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/266936#M57978</guid>
      <dc:creator>ath_123</dc:creator>
      <dc:date>2016-04-28T13:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/266950#M57981</link>
      <description>&lt;P&gt;Without seeing the code or the data its hard to say, but one thing you can do is to pass through the processing to the database and then retrieve the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
  connect to oracle (path=...);
  create table WANT as
  select * from connection to oracle (select count(*) from &amp;lt;your_table&amp;gt;);
quit;&lt;/PRE&gt;
&lt;P&gt;This will pass the select count(*) from your table through to the database to process, then it will return the result to SAS. &amp;nbsp;You could also try filtering your data, I mean count(*) is not the most efficient solution, you will want to be looking at the minimum data, so where out any records you don't need, drop any columns you don't need - * is quite frowned upon:&lt;/P&gt;
&lt;PRE&gt;select count(VAR) 
from (select VAR from HAVE where COND="YES")  
/* Minimise the data with where and only take variables you need */&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 13:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/266950#M57981</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-28T13:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/266998#M57993</link>
      <description>Chances are that this query already are being sent to the RDBMS. Use &lt;BR /&gt;Options msglevel = I sastrace = ',,,d' sastraceloc = saslog nostsuffix;&lt;BR /&gt;to find out.&lt;BR /&gt;If this is a case this a matter of Oracle tuning - talk to the DBA.</description>
      <pubDate>Thu, 28 Apr 2016 15:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/266998#M57993</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-28T15:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query performance issue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/267161#M58006</link>
      <description>&lt;P&gt;Yeah. It is Oracle DBA job. You can query Meta Data(Dictionary table) to get the number of records of a Oracle Table.&lt;/P&gt;
&lt;P&gt;Ask&amp;nbsp;&lt;SPAN&gt;Oracle DBA how to write this kind of Oracle SQL statement, and Pass - through it by SAS Proc sql .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 03:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-query-performance-issue/m-p/267161#M58006</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-04-29T03:50:58Z</dc:date>
    </item>
  </channel>
</rss>

