I'm using SAS to process data and then write the result in BigQuery database through Simba ODBC driver. I have managed to get this working using proc sql create table, but writing the data takes insanely long time. I tried inserting around 200 rows of data with 4 short string values. This query takes around 7 minutes to finish. Inserting 2000 takes 1 hour. Does anyone know how to insert rows efficiently to BigQuery?
Can you please provide some more information, like:
- SAS version
- What SAS/Access module your are using
- options used in your libnmae statement
- topography of your set-up
Usually bulk-load is the fastest way to load an external DB, that might be available depending on the answers to the questions above.
Using these options might give some clue on the processing:
options msglevel=i sastrace=',,,d' sastraceloc=saslog nostsuffix;
You say that you insert observations. What if you use a simple DATA step to write the SAS dataset to the database?
In my experience the default settings that tune database loading are not optimal. I've had excellent load performance by adding these options to the LIBNAME or CONNECTION statement pointing at the database:
libname MyDB ODBC < connection settings > dbcommit = 0 insertbuff = 10000;
However you may need to experiment with these options to get the best performance.
To date, you haven't posted any SAS logs of your slow steps. That means we have no idea what techniques you are using. In my experience some techniques are better than others. If you want to make further progress then I suggest you post one or two slow steps so we can get a better idea of what techniques you use.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.