Friday, March 9, 2012

Expensive logical reads on INSERT - SQL 2005

Hi, I have an insert that is taking about 500ms to execute.
This is on a table with about 1,000,000 rows. The table has a number of
indexes, a PK, one default value but no relationships.
The profile displays logical reads=31 writes=6.
The statement is SQL in an app rather than a stored procedure.
Would anyone know why I have so many writes on a simple insert statement?
Many thanks,
Robert
Each index requires a write, as well as the table entry.
How many indexes?
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Robert" <Robert@.discussions.microsoft.com> wrote in message
news:154CA998-B62F-4871-B739-FE830AE0114F@.microsoft.com...
> Hi, I have an insert that is taking about 500ms to execute.
> This is on a table with about 1,000,000 rows. The table has a number of
> indexes, a PK, one default value but no relationships.
> The profile displays logical reads=31 writes=6.
> The statement is SQL in an app rather than a stored procedure.
> Would anyone know why I have so many writes on a simple insert statement?
> Many thanks,
> Robert
>
|||Hi Arnie, thank you for the answer.
I pretty much understand the writes - will be the data and the overhead of
updating the indexes. The table has a primary key index and a few
non-clustered indexes spanning one or more columns.
I do not understand the reads though. Are these to do with the indexes too?
Other insert/updates do not seem to have this overhead.
Regards,
Robert
"Arnie Rowland" wrote:

> Each index requires a write, as well as the table entry.
> How many indexes?
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the
> top yourself.
> - H. Norman Schwarzkopf
>
> "Robert" <Robert@.discussions.microsoft.com> wrote in message
> news:154CA998-B62F-4871-B739-FE830AE0114F@.microsoft.com...
>
>

No comments:

Post a Comment