<?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: Copy a work.table to POSTGRES database is taking a long time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840820#M332452</link>
    <description>Also could try other PROC like :&lt;BR /&gt;PROC SQL&lt;BR /&gt;PROC COPY&lt;BR /&gt;PROC APPEND&lt;BR /&gt;&lt;BR /&gt;to copy data into PG .</description>
    <pubDate>Wed, 26 Oct 2022 11:33:10 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-10-26T11:33:10Z</dc:date>
    <item>
      <title>Copy a work.table to POSTGRES database is taking a long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840558#M332341</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are trying to copy a work table (72 millions obs) to a POSTGRES database and it is taking a long time to run. We had a similar issue to copy a huge work table to SQL Server database and we solve it put INSERTBUFF options (32767) at library level.&lt;/P&gt;&lt;P&gt;Down below I share the comparison between copying a work table to SQL Server (we already have it optimized) VS copying it to POSTGRES database:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Egrodrigues2014_6-1666707302836.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76573i13AC711AD654EBD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Egrodrigues2014_6-1666707302836.png" alt="Egrodrigues2014_6-1666707302836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Postgres execution (STG_PG.PRUEBA3):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Egrodrigues2014_7-1666707316214.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76574iCD3EF31D8DAFC7E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Egrodrigues2014_7-1666707316214.png" alt="Egrodrigues2014_7-1666707316214.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SQL Server execution (staging.PRUEBA3):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Egrodrigues2014_8-1666707335534.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76576iCDA9CF18AADF2BEC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Egrodrigues2014_8-1666707335534.png" alt="Egrodrigues2014_8-1666707335534.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the odbc.ini level this is the configuration for SAS/ACCESS Interface to PostgreSQL:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Egrodrigues2014_9-1666707347782.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76577i8F71B45EE5CA7553/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Egrodrigues2014_9-1666707347782.png" alt="Egrodrigues2014_9-1666707347782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Finally, we execute the following code (same as before) with BULK_LOAD, BL_PSQL_PATH and BL_DELETE_DATAFILE at dataset options level and real time decreased:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="Egrodrigues2014_10-1666707367267.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76578iB74CB07A26833A22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Egrodrigues2014_10-1666707367267.png" alt="Egrodrigues2014_10-1666707367267.png" /&gt;&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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Egrodrigues2014_11-1666707373731.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76579i7C049C8A46E999E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Egrodrigues2014_11-1666707373731.png" alt="Egrodrigues2014_11-1666707373731.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to configure these options at the library level (BL_PSQL_PATH and BL_DELETE_DATAFILE)? How can I set these options so that BULK LOAD is always active?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, if anyone has faced this problem before or knows what is missing, please, let us know. It will be more than welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840558#M332341</guid>
      <dc:creator>Egrodrigues2014</dc:creator>
      <dc:date>2022-10-25T14:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a work.table to POSTGRES database is taking a long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840629#M332380</link>
      <description>&lt;P&gt;I would suggest opening a support ticket with SAS so they can walk you through the options available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure why you went to the effort of taking photographs of the text of your SAS code and log and then annotating the text with little red squares.&amp;nbsp; It would be a lot easier to just copy and paste the actual text.&amp;nbsp; &lt;STRONG&gt;Plus it would be a lot easier to read.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What ENGINE are you using to connect to POSTGRES?&amp;nbsp; What ENGINE did you use to connect to the other database?&amp;nbsp; Have you licensed any of the database specific SAS/Access products from SAS?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 17:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840629#M332380</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-25T17:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a work.table to POSTGRES database is taking a long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840671#M332399</link>
      <description>&lt;P&gt;You may need to try the DBCOMMIT as well to see if that improves performance. Setting the bulk load options for all POSTGRES queries seems a bit dangerous to me as it is really only appropriate for large data loads. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;says, working through the options with Tech Support is your best option.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840671#M332399</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-10-25T20:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a work.table to POSTGRES database is taking a long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840774#M332432</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;, thanks for the suggestions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using POSTGRES and ODBC engine to connect to POSTGRES and SQL Server respectively. These products are licensed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 09:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840774#M332432</guid>
      <dc:creator>Egrodrigues2014</dc:creator>
      <dc:date>2022-10-26T09:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a work.table to POSTGRES database is taking a long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840820#M332452</link>
      <description>Also could try other PROC like :&lt;BR /&gt;PROC SQL&lt;BR /&gt;PROC COPY&lt;BR /&gt;PROC APPEND&lt;BR /&gt;&lt;BR /&gt;to copy data into PG .</description>
      <pubDate>Wed, 26 Oct 2022 11:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840820#M332452</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-26T11:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a work.table to POSTGRES database is taking a long time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840854#M332468</link>
      <description>&lt;P&gt;Performance is quite hard to tackle.&lt;/P&gt;
&lt;P&gt;You want to isolate the different system components.&lt;/P&gt;
&lt;P&gt;For instance, can you do isolated (local) bulk-loads in each DB? That will tel you if this a DB specific problem or not.&lt;/P&gt;
&lt;P&gt;Then there's networking.&lt;/P&gt;
&lt;P&gt;Also, is there's a way to verify that bulk load is actually in effect for Postgres?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I get a bit confused by the log for Postgres, since it states "SQLSVR engine" - maybe a "bug" in the SAS/ACCESS to Postgres engine?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-work-table-to-POSTGRES-database-is-taking-a-long-time/m-p/840854#M332468</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-10-26T12:42:26Z</dc:date>
    </item>
  </channel>
</rss>

