![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello! I have an big table with 50Gb data, written som functions that cleanup data and want to do something like this insert into newtable select id, func1(col1), func2(col2) from oldtable; I'm also plan to make newtable partioned (before insert). But how could i get the insert as fast as possible? Greetings Bjorn D. Jensen |
#3
| |||
| |||
|
|
I have an big table with 50Gb data, written som functions that cleanup data and want to do something like this insert into newtable select id, func1(col1), func2(col2) from oldtable; I'm also plan to make newtable partioned (before insert). But how could i get the insert as fast as possible? |
#4
| |||
| |||
|
|
The quickest way to do this is to use INSERT INTO...SELECT FROM as it is a non-logged operation |
#5
| |||
| |||
|
|
Exactly what is in those functions? Do they perform data access? Are they written in T-SQL or in the CLR? I ask, because they could have a great impact on performance. |
#6
| |||
| |||
|
|
Functions are written in T-SQL (i also wrote them in CLR, but in this case they were slower). The original columns have incorrect datatypes, that uses too much storage, so the functions check that values are in correct domain and if not they return null - what is a correct result, because the values then are physical impossible. |
|
I wondered why you only wrote that I can't use "select into" for patitioned tables. |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
As I see the cast is not needed, because the functions return correct datatype. Is it that what you mean with "inline"?? |
|
I think there is another problem: the original table is not in the right filegroup and if I understand it right, It must be or must be to make switch ultra fast; |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
I didn't understand the last part about "ditch" (what means that?). |
|
Will the use of functions make the select into very slow? |
![]() |
| Thread Tools | |
| Display Modes | |
| |