Hi,
I have simple "insert into.." query which is taking around 40 seconds to execute. It simply takes records from one table and inserts into another.
- I have index on F1 and BatchID on the tbl_TempCatalogue table
- 146624 records are effected.
- select itself is not slow insert into is slow.
The complete query is
insert into tbl_ItemPrice
(CATALOGUEVERSIONID,SERIESNUMBER,TYPE,PRICEFIELD,PRICE,
PRICEONREQUEST,recordid)
select 296 as CATALOGUEVERSIONID
,ISNULL(F2,'-32768') as SERIESNUMBER
,ISNULL(F3,'-32768') as TYPE
,ISNULL(F4,'-32768') as PRICEFIELD,F5 as PRICE
,(case when F6 IS NULL then null when F6 = '0' then 'False'
else 'True' end ) as PRICEONREQUEST
,newid()
from tbl_TempCatalogue
where F1 = 450
and BATCHID = 72
Thanks, Lalit