Click here to Skip to main content
15,906,574 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have a database with several tables with guid clustered column table1 have 10 rows only, table_2 have 300K rows table_2 also have 3 triggers.

I faced a very slow insert on table_2 (0.3 - 0.7) sec on very simple insert (insert into table_2 (t50) values (1))

I did the following using sql management studio :

1- set guid to a non-clustered .

2- add int unique id clustered column with auto increment.

3- drop and recreate the table (management studio did the drop and recreate when apply changes).

4- drop all triggers on table_2.

5- set database backup model to simple.

and i did shrink the database using this t-sql

ALTER DATABASE Mydatabase SET RECOVERY SIMPLE
DBCC SHRINKDATABASE (Mydatabase , 1).

insert still takes (0.3 - 0.7) second on table_2 and even on table_1

Notes:
table_1 have only 3 column and 10 rows.

hard disk drive is ssd, cpu core i7 , ram 16GB

Any idea ???!!
Posted

1 solution

There are a lot of possibilities. For example your hardware might be the cause so investigate using for example Windows Performance Monitor:
- disk queue length
- CPU utilization
- memory issues, especially paging.

On the other hand it might well be the database:
- what do the triggers do, long running operations there?
- how many indexes you have on the table
You can use SQL Server Trace to investigate these

And the last element is the network. If the SQL Server trace shows reasonable response time which, then investigating the network would be in place.
 
Share this answer
 
Comments
M. Rawan 29-Jul-15 7:59am    
Thank you for replay it was a non related problem and we figure it out
Wendelius 29-Jul-15 8:06am    
Glad to hear you got it solved

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900