August 29, 2020 at 1:46 am
So I had a performance issue with a developer attempting to import over a billion records into a hash table (no indexes no keys etc...) using similar code "INSERT INTO TABLENAME SELECT COLUMN A, COLUMN B FROM QUERY"
It took about 5.5 hours total, but with the below hack I was able to drop it down to 3.5 hours.
By including the "INSERT INTO TABLENAME WITH (TABLOCK) SELECT COLUMN A, COLUMN B FROM QUERY" it appears starting with SQL Server 2016+, inserts will be using parallelism compared to the old serial method of inserting records. The maxdop I had for the server is 8.
Tung Dang
Azure and SQL Server DBA Contractor / Consultant
DataZip
August 29, 2020 at 6:48 am
What is your question?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy