<?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: Slow performance of ODBC connection to SNOWFLAKE in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502846#M15607</link>
    <description>&lt;P&gt;Thank you for that info Jeff,&amp;nbsp;I wrongly assumed that the VARCHAR issue would be solved by SAS Connect replacing ODBC, I'll update my internal SAS request regarding the development of SAS Connect for Snowflake.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 18:45:14 GMT</pubDate>
    <dc:creator>curaloco</dc:creator>
    <dc:date>2018-10-09T18:45:14Z</dc:date>
    <item>
      <title>Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/461731#M14336</link>
      <description>&lt;P&gt;We are setting up a new SAS FAW environment that is connecting to Snowflake (ODBC)&amp;nbsp;and S3 as our data sources.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Opening a Snowflake table in SAS Enterprise Guide 7.15 takes a really long time (5-16 hours) for medium sized tables, Character variable length in Snowflake seems to be&amp;nbsp;one of the reasons, being this: &lt;SPAN&gt;VARCHAR(16777216) the default length for character variables&amp;nbsp;in Snowflake&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have tried creating a SAS view, which solves the speed problem, but it demands a manually intensive process to determine the right length of each character variable and it only works after the Snowflake table has been completely scanned which could take a long time, or simply does not finish. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Are there any other approaches or configuration changes to the ODBC parameters that could help?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is somebody else facing the same issues when connecting to Snowflake using ODBC? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 00:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/461731#M14336</guid>
      <dc:creator>curaloco</dc:creator>
      <dc:date>2018-05-12T00:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/461762#M14339</link>
      <description>The post is created now &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;.</description>
      <pubDate>Sat, 12 May 2018 07:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/461762#M14339</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-05-12T07:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/461995#M14352</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 11:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/461995#M14352</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-05-14T11:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/464065#M14450</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/47455"&gt;@curaloco&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TL;DR -&amp;nbsp;&lt;SPAN&gt;best practice is to set the lengths when creating variable length character columns.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem you are experiencing is likely caused by not putting a length on VARCHAR column definition. The EG issue is separate but exacerbated by the text column lengths expanding. It is not a good idea to open an entire table in an EG viewer because it is going to read the entire thing into SAS. At a minimum it is best to limit the number of rows displayed in EG (Tools --&amp;gt; Options --&amp;gt; Query --&amp;gt; Number of rows to process in preview results window).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is important to understand that these issues are not unique to Snowflake it can happen with many DBMSs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example showing the character length issue:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname snowdmax odbc dsn='snowflake_DSN' schema=PUBLIC  
                      user=myuser pw=passwd123
                      dbcommit=0 autocommit=no 
                      readbuff=100 insertbuff=100
                      dbmax_text=10;
&lt;BR /&gt;/* This code can be used to spit out the ODBC driver options */
libname prompt odbc prompt=yes;
%put %superq(sysdbmsg);


/* notice I am not setting the lengths here */
data snow.cars_dbtype (dbtype=(make='string', model='varchar', type='varchar',origin='text'));
   set sashelp.cars;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Let's see what the columns look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="columns_32k.jpg" style="width: 488px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20689iA440BD28C40476F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="columns_32k.jpg" alt="columns_32k.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice: 32K columns. This is not good.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's create a SAS data set from the Snowflake table and see if DBMAX_TEXT= helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.snow_cars;
   set snow.cars_dbtype;
run;&lt;BR /&gt;&lt;BR /&gt;/* Lets compare it to one with length information */&lt;BR /&gt;&lt;BR /&gt;data snow.good_cars;&lt;BR /&gt; set sashelp.cars;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data work.good_cars;&lt;BR /&gt; set snow.good_cars;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result... Notice the size difference... DBMAX_TEXT= didn't help. It only works on BLOBs. I think this is a problem and am going to try to do something about it. Some ODBC drivers will let you limit the length of text strings. Unfortunately, the Snowflake ODBC driver doesn't appear to be one of these. I will ask them about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Back to the size...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snow_32k.jpg" style="width: 467px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20690iE32D92FF4CBE3A91/image-size/large?v=v2&amp;amp;px=999" role="button" title="snow_32k.jpg" alt="snow_32k.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It's a huge difference. This problem will cause&amp;nbsp;performance issues when reading and writing. It also causes&amp;nbsp;one of the sneakiest SAS issues I have ever seen. It happened with Hadoop but this is the same issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A call came into SAS Tech Support concerned about SASWORK running out of space. It took a while to discover that&amp;nbsp;expanding character column lengths&amp;nbsp;was causing the problem. Initially, the customer added space to SASWORK. It didn't address the problem although it did postpone it for a while.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, the best practice is to set the lengths when creating variable length character columns.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 18:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/464065#M14450</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-05-22T18:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502557#M15599</link>
      <description>&lt;P&gt;Than you for the response. As you point out the current Snowflake ODBC connection available is susceptible to undefined VARCHAR lengths, SAS does not like them and it blows the available memory. Best way to deal with the VARCHAR lengths is altering them in Snowflake directly. I have to test your recommendation for limiting the number of rows displayed inside EG, just a heads up that,&amp;nbsp;when trying to limit the number of rows,&amp;nbsp;if you try to limit them using PROC SQL outobs=xxx; or DATA;SET &amp;nbsp;(obs=xxx) , it does not work. The whole table will get loaded into SAS memory and then it will show you the number of rows you requested, defeating the purpose of just loading a subset of the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Until&amp;nbsp;SAS Connect is developed to replace the ODBC connection to Snowflake,&amp;nbsp;I am using SQL pass thru&amp;nbsp;for Snowflake, it works faster as it sends all the processing to Snowflake and just grabs the results back for SAS to display.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502557#M15599</guid>
      <dc:creator>curaloco</dc:creator>
      <dc:date>2018-10-09T00:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502665#M15603</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/47455"&gt;@curaloco&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am happy my post solved your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The VARCHAR length issue is a problem with all SAS/ACCESS engines. Having a dedicated Snowflake engine will not magically fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 12:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502665#M15603</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-10-09T12:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502839#M15606</link>
      <description>&lt;P&gt;But perhaps a VARCHAR data type in SAS would help the situation...&lt;/P&gt;
&lt;P&gt;...which is available in Viya. Would be interesting to see if there are some lessons learned from a Viya - Snowflake (or any other DBMS with unspecified string lengths).&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 18:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502839#M15606</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-10-09T18:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502846#M15607</link>
      <description>&lt;P&gt;Thank you for that info Jeff,&amp;nbsp;I wrongly assumed that the VARCHAR issue would be solved by SAS Connect replacing ODBC, I'll update my internal SAS request regarding the development of SAS Connect for Snowflake.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 18:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/502846#M15607</guid>
      <dc:creator>curaloco</dc:creator>
      <dc:date>2018-10-09T18:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/702504#M19667</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;&amp;nbsp; Thanks for your inputs! How do we set these parameters while using Passthrough? With Greenplum, I was able to set lengths of the variables using VARCHAR option but this doesn't seem to work for Snowflake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this, FIRST_NAME :: VARCHAR(50) AS FIRST_NAME&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 14:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/702504#M19667</guid>
      <dc:creator>sai212</dc:creator>
      <dc:date>2020-11-30T14:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/702618#M19668</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68232"&gt;@sai212&lt;/a&gt;&amp;nbsp; - Please don't post new problems in existing posts. Create a new post and add a link back to this one. In any case you should post your complete SAS log and not just bits of code.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 19:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/702618#M19668</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-30T19:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Slow performance of ODBC connection to SNOWFLAKE</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/702774#M19671</link>
      <description>Sorry, these are my first posts and I wasn't aware.</description>
      <pubDate>Tue, 01 Dec 2020 10:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Slow-performance-of-ODBC-connection-to-SNOWFLAKE/m-p/702774#M19671</guid>
      <dc:creator>sai212</dc:creator>
      <dc:date>2020-12-01T10:15:57Z</dc:date>
    </item>
  </channel>
</rss>

