Paste Into from Select Performance SQL Server

I created a query in which I insert the result of a selection from another table into an empty table.

This select takes ~ 20 minutes (30 M rows, 120 columns and Where), but insert takes ~ 1 hour .

Do you have any suggestions for improving it?

What I did, as in the example below.

Insert Into tableA
Select *
From TableB

Appreciate your help!

+4
source share
2 answers

Drop all indexes on TableA, then paste again:

INSERT INTO tableA
SELECT * FROM TableB

Indexes are known to slow down insertion instructions.

+2
source

, TableA ( , ..), .

, , TableA. / TableB , . TableB.txt, / TableB.txt TableA. (, SQL Server).

. , BULK_LOGGED, :

0

Source: https://habr.com/ru/post/1663718/


All Articles