I'm a statistics grad student who programs a lot of simulations. One of my simulations spans several computers (due to licensing contrainsts). The stat results for the current simulation consumes 4GB on SqlServer 2005. The performance of the current schema was fine when I was developing it on an empty database. But now that the project is almost completed, the deletes are taking a very long time. Deleting one tblBatch row used to finish in less than a second; now it's over 20 seconds.
I'm asking this question because I want to design my next simulation database better. I don't think I'll change the current schema because rows are only deleted if they were created by a unit test; and I can just increase the TimeOut value for the tests. The performance of the reads and writes is still fine.
From a database perspective, would it have been better to do the many-to-many relationship more conventionally? I'm thinking tblModelSingle should have been a junction table by making:
-one tblBatch row to many tblChunk rows,
-one tblChunk row to many tblModelSingle rows,
-one tblDataFile row to many tblModelSingle rows,
-one tblModelChunk row to many tblModelSingle rows, and
-one tblModelSingle row to one tblModelSpec row.
When I first started this project 18 months ago, I avoided doing this conventional way because my C# program would have had to be more chatty with the database. But now I'm guessing that would have been an acceptable tradeoff.
In addition to quicker deletes, are there likely to be other benefits if I had used the conventional approach.
Currently, one tblBatch row has 16 tblChunk rows. One tblChunk row has 100 tblDataFile rows and 243 tblModelChunkRows --and thus 24,300 tblModelSingle and 24,300 tblModelSpec rows. (One reason for the complication is that the expensive stat software estimates one model for one dataset in 10sec, but estimates one model for 100 datasets in 20sec).
Additional Details
-My database server is on P4 with 3GB of ram, but task manager shows that the PF usage never exceeds 2GB.
-SqlServer 2005 Standard and Windows Server 2003 32-bit.
-Two 7,200 Barracudas with plenty of space. (One drive is for the OS and the log file, the other drive is for the MDF)
-All the indices in all the tables have been rebuilt/defragged.
-The physical MDF file doesn't need to be defragged. It's 4GB in only 3 fragments.
If you see other weaknesses, I'm open to any criticisms. If you're still reading at this point in the post, Thanks.