<?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: Delete with an exists statement really slow in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386836#M24922</link>
    <description>&lt;P&gt;Two questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, the obvious one. How "slow" is really slow? How long is it taking?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, what kind of tables are "DATA1" and "DATA2". SAS datasets? Database tables accessed via SAS/Access? Other?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if they're database tables, which technology (Oracle, DB2...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2017 22:42:20 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2017-08-09T22:42:20Z</dc:date>
    <item>
      <title>Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386832#M24920</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
delete from DATA1 a
	where exists (select 1 from  DATA2 b where a.ID = b.ID and a.ID2 = b.ID2);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This statement is tremendously slow&amp;nbsp;for a table with 8.3 million rows.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 22:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386832#M24920</guid>
      <dc:creator>mgm</dc:creator>
      <dc:date>2017-08-09T22:27:02Z</dc:date>
    </item>
    <item>
      <title>Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386833#M24937</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
delete from DATA1 a
	where exists (select 1 from  DATA2 b where a.ID = b.ID and a.ID2 = b.ID2);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This statement is tremendously slow&amp;nbsp;for a table with 8.3 million rows, any suggestions on improving the performance ?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 22:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386833#M24937</guid>
      <dc:creator>mgm</dc:creator>
      <dc:date>2017-08-09T22:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386836#M24922</link>
      <description>&lt;P&gt;Two questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, the obvious one. How "slow" is really slow? How long is it taking?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, what kind of tables are "DATA1" and "DATA2". SAS datasets? Database tables accessed via SAS/Access? Other?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if they're database tables, which technology (Oracle, DB2...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 22:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386836#M24922</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-08-09T22:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386845#M24938</link>
      <description>&lt;P&gt;With 8.3M rows I would have thought either indexing the ID and ID2 fields on both files or pre-sorting them by ID and ID2 might help.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 00:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386845#M24938</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-08-10T00:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386879#M24930</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/85267"&gt;@mgm&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
delete from DATA1 a
	where exists (select 1 from  DATA2 b where a.ID = b.ID and a.ID2 = b.ID2);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This statement is tremendously slow&amp;nbsp;for a table with 8.3 million rows.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;- define "slow". Use options fullstimer to get a clear picture.&lt;/P&gt;
&lt;P&gt;- given that all datasets reside in WORK, and the SQL utility file will also be placed there, I'm not surprised that the performance of this step is dismal. Depending on the size of data2, I'd either use sort/data steps, or a format created from data2, or a hash object created from data2.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 07:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386879#M24930</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-10T07:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386880#M24931</link>
      <description>Correlated subquery with exists can be slow.&lt;BR /&gt;Indexing on id could help.&lt;BR /&gt;But if your id is unique it could be faster recreating the table with a data step merge (like if a a not b).</description>
      <pubDate>Thu, 10 Aug 2017 07:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386880#M24931</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-08-10T07:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Delete with an exists statement really slow</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386987#M24954</link>
      <description>&lt;P&gt;I would try Hash Table if the table is very big.&lt;/P&gt;
&lt;P&gt;Or try this one , maybe save you some time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;delete&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; DATA1
	&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; catx('|',ID,ID2) in &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; catx('|',ID,ID2) &lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt;  DATA2 &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 13:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Delete-with-an-exists-statement-really-slow/m-p/386987#M24954</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-10T13:31:44Z</dc:date>
    </item>
  </channel>
</rss>

