Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Jampandu
Starting Member
12 Posts |
Posted - 2014-03-13 : 12:19:28
|
Hi experts,below simple delete statement is taking around 50 sec to execute.DELETE TOP(500) aFROM Table1 aWHERE exists (SELECT 1 FROM #table2 b WHERE a.pkcol=b.pkcol) HereThere is no indexes on Table1 except primary key.table1 is highly transnational table#table2 is temp table with 5000 records Any suggestions please Thanks! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-03-13 : 13:26:06
|
Is pkcol indexes in #table2? Is the query being blocked at all? Have you tried setting the batch size smaller and deleting again and again until you reach the number?What does the execution plan show? Add this to your script and show us the output:set statistics io onset statistics time onTara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|