I know there are a lot of aspects with SQL tuning. This question is more specific though...
Does the number of indexes or using the wrong index affect the performance on INSERT statements on SQL Server?
What do you mean by using wrong index on an INSERT?
And why are you thinking about that? Someone told me that normally in a db you have 10 reads for each write so in theory adding keys (and SIFTs) to speed up reads is most of the time worth the extra time on writes.
Don't modify any of the trigger code though, that manages SIFT values, and you don't want to mess around with that. The SIFT values are maintained by those table triggers. For each INSERT, MODIFY and DELETE it runs that code to maintain the values in the SIFT tables. The more SIFT keys you have, the more values it has to maintain, the longer it takes to insert a record.
Similarly, when a record is inserted into a SQL Server table, it has to update all indexes that are associated with the table. Logically then, the more indexes on the table, the longer it takes to insert a record. You can't select an index for an insert.
Every time you insert a new record SQL Server has to write records and for each index save fields in index. So it affect performance because has to be written more information.
But has Mark Brummel said SIFT can be a nightmare. There are some several updates in those tables so it much worse than a index.
Answers
Have a look at the SQL Server management studio and open the triggers of the G/L Entry table.
Step 1. Eliminate SIFT
Step 2. Disable duplicate index.
Step 0. Goto Hyneks class at directions.
What do you mean by using wrong index on an INSERT?
And why are you thinking about that? Someone told me that normally in a db you have 10 reads for each write so in theory adding keys (and SIFTs) to speed up reads is most of the time worth the extra time on writes.
Similarly, when a record is inserted into a SQL Server table, it has to update all indexes that are associated with the table. Logically then, the more indexes on the table, the longer it takes to insert a record. You can't select an index for an insert.
RIS Plus, LLC
So Mark are you saying that an 1 hour class will give us a basic foundation on Navision - SQL issues?
It's not a 1 hour class. If it was, I'd be all over it like fly on poo.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
But has Mark Brummel said SIFT can be a nightmare. There are some several updates in those tables so it much worse than a index.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
Very powerful image Alex :sick:
And Hynek has a session for 1 hour at Directions itself. I guess Mark may have meant the 2 days class.
Will disable some MaintainSIFTIndex first before disabling MaintainSQLIndex.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
RIS Plus, LLC