![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
and your where clause is ON That Keyed column ? If your delete is taking a long time and the where on that you could have a few problems: 1. Fragmented indexes 2. Out of date Statistics 3. Missing Statistics 4. Poorly performing IO Subsystem (Disk Queueing) 5. blocking Greg Jackson PDX, Oregon |
#12
| |||
| |||
|
|
I have a table with around 38000 records in it. I'm trying to delete records (about 3000) from it but it takes forever! There has been several million rows added and removed from this table before but now it's taking way too long (currently 7 min and running). I'm doing delete from my table where mycol = 1. If I change this to delete from my table where id in (select id from mytable where mycol = 1) It is much quicker but still 2 minutes or so. |
#13
| |||
| |||
|
|
I rebuilt in index on the table and all is much better. "Joe" <J_no_spam (AT) _no_spam_Fishinbrain (DOT) com> wrote in message news:#iE9pJ5EFHA.4052 (AT) TK2MSFTNGP14 (DOT) phx.gbl... I have a table with around 38000 records in it. I'm trying to delete records (about 3000) from it but it takes forever! There has been several million rows added and removed from this table before but now it's taking way too long (currently 7 min and running). I'm doing delete from my table where mycol = 1. If I change this to delete from my table where id in (select id from mytable where mycol = 1) It is much quicker but still 2 minutes or so. |
#14
| |||
| |||
|
#15
| |||
| |||
|
|
I was wrong this didn't fix my problem. It did for the select but not the delete. The table has a total of 4 columns. 1 PK and 3 FK. None of these table are extremely large. |
#16
| |||
| |||
|
|
what is "Scan Density" at ? If Scan Density is > 80% youre fine. If Extent Scan Fragmentation is 26% I guess that means scan density is 74%. (Jaxon aint no math major) that is a little on the bad side but not horrific. you defrag indexes to move scan density back to 100% (no fragmentation) use DBCC DBReindex or DBCC IndexDefrag to accomplish GAJ |
#17
| |||
| |||
|
#18
| |||
| |||
|
|
???? no dude....... can you run this for me in your database of Question: DBCC SHOWCONTIG (XXX) GO Where "XXX" is your table that you are deleting from then paste the entire output back to me GAJ |
#19
| |||
| |||
|
#20
| |||
| |||
|
|
I dont think this table has a clustered index on it the Scan Density doesnt make sense GAJ |
![]() |
| Thread Tools | |
| Display Modes | |
| |