
John,
Thank you for your help. After checking by using DBCC SHOWCONTIG, I found
that the index have around 40% Extent Scan Fragmentation after inserting
35000 records to the table. According to the Books Online, 0-10% may be
acceptable. It seems that after inserting 35K records, the index must be
rebuild. So trying DBREINDEX, even in transaction, the SQL execute much
faster and the performance is acceptable.
However, i have tried again for the whole process without transaction, and
check against the index fragmentation, the index also have around 40% Extent
Scan Fragmentation after inserting 35K records, the SQL also execute very
fast without DBREINDEX!! I really don't understand the underlying behaviour
of the SQL server. With transaction and without transaction would result in
huge performance change. Hope someone could explain it or giving direction
of this issue. Would it related to SQL server setting or memory issue?
Finally, the problem seems solved except that DBREINDEX cannot be executed
in my application, since the application does not have enough privilege.
Application role will set for every user and after set application role, the
privilege cannot be changed as i known. But this is my application problem
only. I will find a way to solve it.
Thank you for your supporting.
Martin