BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hi Everyone,

 

I was wondering, whether there exist any benchmark values regarding upload performance of a MATable-File to MS SQL DAtabase?

Here is, what I do:

I am only refreshing the metadata counts (i.e. MaTables-File) of four nodes:FK1_0-1590510089628.jpeg

 

What CI does in the background ist initializing a Stored Process Session and among other things executing a macro called "MAUPLOAD". 

This macrio, in turn, uploads the locally stored MAtable.sas7bdat-file of the MATables-Libary "MATables.THAAEVZZSKRHHRUZT{SASusername}"to the database.

 

In my case, we are talking of a file that has only one column, but roughly 6.4 million rows.

 

Even though I am already pimping the sql-query by setting READ- and WRITEBUFFER to 32767 it still takes about 3 minutes:

FK1_1-1590510779530.png

Shouldn't this be faster?

We are using the ODBC Driver  17 for SQL Server, which apparently is not supporting Bulkload

 

FK1_2-1590510955774.jpeg

 

, because every time I am trying to Add BULKLOAD = YES as a option within the porperties of the business context,

 

bc_option.JPG

 

what CI in the background does, is running a STP and executing a macro called "MAVALUPD". There the error happens:

 

 

"BCP=/BULKLOAD= option not supported by this datasource"

 

bulkload_option_error.JPG

Any help would be very much appreciated.

 

Thx,

FK

1 ACCEPTED SOLUTION

Accepted Solutions
JamesAnderson
SAS Employee
Hi FK1,
Using bulk load with the SAS/Access to SQL Server is a little different to other access engines - your libname statement says SQLSVR so you are using this not SAS/Access to ODBC.
Firstly you should use the ODBC driver that is provided by SAS, which includes bulk loading capabilities (it looks like you are using the Microsoft driver):
[A screenshot of a social media post Description automatically generated]
Secondly in the ODBC DSN configuration, using the SAS provided driver, you have the ability to configure bulk load:
[A screenshot of a cell phone Description automatically generated]
And lastly, even though you have configured bulk load in the driver, you don't reference BULKLOAD in the library/dataset options or in your case in the Business Context Options, you reference INSERTBUFF and DBCOMMIT.
I did a test using a combination of Driver Bulk load, INSERTBUFF and DBCOMMIT. In the test I loaded something resembling an MATables (single numeric column) with 6 million records, using Enterprise Guide and PROC APPEND (which is what maupload stored process uses):
[INSERTBUF=32767] : 3 min 4 seconds
[INSERTBUF=32767 + DBCOMMIT=0] : 2 min 40 seconds
[Driver Bulk load + INSERTBUF=32767] : 1 min 10 seconds
[Driver Bulk load + INSERTBUF=32767 + DBCOMMIT=0] : 9 seconds
I recommend you switch drivers and turn on bulk load within the driver.
Cheers
James

View solution in original post

9 REPLIES 9
infomevijay
Obsidian | Level 7

I would recommend you to get rid of the cell nodes after each selection which will create an implict AND between the two selection nodes. The MATables are generated due to the cell nodes. The first cell node is generating the MATable which is uploaded into the database. If you are using cell nodes, MATables will be created and stored in the MATables library. To optimize the query performance, SAS loads the MATable in to the CI_TEMP (dbtmplib) schema on the database and they runs the query generated by the second select node. It is always recommened to have bulk load enabled for dbtmplib library. You are using ODBC which is lacking bulk load. I can see that you have SAS Access to SQL server, you should be using SAS/ACCESS to SQL server instead of ODBC for bulk load.

 

The best way to improve the performance is to get rid of the cell node which would eliminate the upload.

 

/Vijay

JamesAnderson
SAS Employee
HI,
Can you post your version of SAS Marketing Automation, the operating system you are using for the SAS Servers, and which SAS/Access engine you are using (SAS/Access to SQL Server or SAS/Access to ODBC).
Thanks
James
FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hi @JamesAnderson ,

 

here, the info, you requested:

 

SAS-Version: SAS 9.4 (9.04.01M6P11152018)

MA-Version : SAS Marketing Automation, Version 6.5,  Build Version: 9.04.01M0P060816

OS: WIN (X64_DSRV16) - Windows 2016 Server, 64 bit

SAS-Access:

SAS/ACCESS Interface to PC Files
SAS/ACCESS Interface to Microsoft SQL Server

infomevijay
Obsidian | Level 7

The SAS/ACCESS engine used for dbtmplib is ODBC engine. You can check the datasource for dbtmplib library, which is SAS_MS_SQL_DB.

infomevijay_0-1590576417297.png

 

The data source SAS_MS_SQL_DB is using ODBC Driver 17 for SQL Server.

infomevijay_1-1590576462951.png

 

FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Yes, the datasource is a ODBC engine. This is because the SAS CI Solution Architect advising us told me, to rather use ODBC engine, than SAS ACCESS to MS SQL. I never understood why ,beause among other things ODBC is not supporting Bulkload!

 

SASKiwi
PROC Star

I have always found using the INSERTBUFF option works well for tuning row inserts for SQL Server. I'm also using ODBC. I suggest you start with INSERTBUFF = 10000 then try other values to compare performance.

JamesAnderson
SAS Employee
Hi FK1,
Using bulk load with the SAS/Access to SQL Server is a little different to other access engines - your libname statement says SQLSVR so you are using this not SAS/Access to ODBC.
Firstly you should use the ODBC driver that is provided by SAS, which includes bulk loading capabilities (it looks like you are using the Microsoft driver):
[A screenshot of a social media post Description automatically generated]
Secondly in the ODBC DSN configuration, using the SAS provided driver, you have the ability to configure bulk load:
[A screenshot of a cell phone Description automatically generated]
And lastly, even though you have configured bulk load in the driver, you don't reference BULKLOAD in the library/dataset options or in your case in the Business Context Options, you reference INSERTBUFF and DBCOMMIT.
I did a test using a combination of Driver Bulk load, INSERTBUFF and DBCOMMIT. In the test I loaded something resembling an MATables (single numeric column) with 6 million records, using Enterprise Guide and PROC APPEND (which is what maupload stored process uses):
[INSERTBUF=32767] : 3 min 4 seconds
[INSERTBUF=32767 + DBCOMMIT=0] : 2 min 40 seconds
[Driver Bulk load + INSERTBUF=32767] : 1 min 10 seconds
[Driver Bulk load + INSERTBUF=32767 + DBCOMMIT=0] : 9 seconds
I recommend you switch drivers and turn on bulk load within the driver.
Cheers
James
JamesAnderson
SAS Employee

Looks like the screenshots of the drivers got dropped...

 

Driver typeDriver typeBulk load configBulk load config

FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hello James,

 

this is exactly, what I was looking for!
I applied all the recommendations from you and this is the result 🙂

 

Summary Statistics for SQLSVR are:
Total SQL execution seconds were: 7.408242
Total SQL prepare seconds were: 0.000476
Total seconds used by the SQLSVR ACCESS engine were 9.406028

 

It really puzzles me, that the CI Solution Architect advised me to use the slow Microsoft Driver rather than the fast SAS ACCESS for SQL Server Driver....

Thank you very much for your quick and very helpful help!

G2 Grid Leader Spring 2025.png

 

 

 

 

Want to review SAS Customer Intelligence 360? Gartner and G2 are offering a gift card or charitable donation for each accepted review. Use this link for G2 to opt out of receiving anything of value for your review.

 

Gartner.jpg

 

SAS Customer Intelligence 360

Get started with CI 360

Review CI 360 Release Notes

Open a Technical Support case

Suggest software enhancements

Assess your marketing efforts with a free tool

 

Training Resources

SAS Customer Intelligence Learning Subscription (login required)

Access free tutorials

Refer to documentation

Latest hot fixes

Compatibility notice re: SAS 9.4M8 (TS1M8) or later

How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

G2 Grid Leader Spring 2025.png

 

 

 

 

Want to review SAS Customer Intelligence 360? Gartner and G2 are offering a gift card or charitable donation for each accepted review. Use this link for G2 to opt out of receiving anything of value for your review.

 

Gartner.jpg

 

SAS Customer Intelligence 360

Get started with CI 360

Review CI 360 Release Notes

Open a Technical Support case

Suggest software enhancements

Assess your marketing efforts with a free tool

 

Training Resources

SAS Customer Intelligence Learning Subscription (login required)

Access free tutorials

Refer to documentation

Latest hot fixes

Compatibility notice re: SAS 9.4M8 (TS1M8) or later

Discussion stats
  • 9 replies
  • 3144 views
  • 1 like
  • 4 in conversation