Table index affects INSERT?

Alex_Chow
Member Posts: 5,063
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?
Does the number of indexes or using the wrong index affect the performance on INSERT statements on SQL Server?
Confessions of a Dynamics NAV Consultant = my blog
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
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
0
Answers
-
Yes it does, but not half as much as the number of SIFT updates.
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.0 -
Alex Chow wrote: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.Apathy is on the rise but nobody seems to care.0 -
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.0 -
Mark Brummel wrote:Step 0. Goto Hyneks class at directions.
So Mark are you saying that an 1 hour class will give us a basic foundation on Navision - SQL issues?Apathy is on the rise but nobody seems to care.0 -
cnicola wrote:Mark Brummel wrote:Step 0. Goto Hyneks class at directions.
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.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
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.0 -
Gotcha. Thank you all for your valuable input.
Will disable some MaintainSIFTIndex first before disabling MaintainSQLIndex.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
You also want to look at individual SIFT levels. Some of the SIFT actually has a good purpose0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions