Translate index plan advice into proper Dynamics NAV key

greys
Member Posts: 29
Hi there,
I've been suggested by some monitoring tool on SQL Server to add a new key to one of my Dynamics NAV-tables. The suggestion is as followes:
Missing index (impact 18.3375): CREATE NONCLUSTERED INDEX [<Name of Missing Index,sysname,>] ON [TESTDATABASE].[dbo].[Schedule] ([Employee Role],[Duty Option]) INCLUDE ([Employee ID],[Employee Type],[Description],[Active]).
I'm having difficulties translating this into a proper Dynamics NAV 2017-key. Does anyone have a suggestion? I understand that I have to add both fields Employee Role and Duty Option to a new key in the Schedule table. But I'm not sure what to do with the other fields mentioned after the INCLUDE-statement. Do they also have to be included in the key?
Greys
I've been suggested by some monitoring tool on SQL Server to add a new key to one of my Dynamics NAV-tables. The suggestion is as followes:
Missing index (impact 18.3375): CREATE NONCLUSTERED INDEX [<Name of Missing Index,sysname,>] ON [TESTDATABASE].[dbo].[Schedule] ([Employee Role],[Duty Option]) INCLUDE ([Employee ID],[Employee Type],[Description],[Active]).
I'm having difficulties translating this into a proper Dynamics NAV 2017-key. Does anyone have a suggestion? I understand that I have to add both fields Employee Role and Duty Option to a new key in the Schedule table. But I'm not sure what to do with the other fields mentioned after the INCLUDE-statement. Do they also have to be included in the key?
Greys
0
Answers
-
The "INCLUDE" part is not directly support by NAV keys. You would need to handle that directly in SQL. Whether or not you want to maintain keys\indexes outside of the NAV development environment is a whole other topic.
Keep one thing in mind with monitoring\analysis tools. They are providing their suggestions based on the current workload. That is the SQL statements currently being executed on the database. They make no determination if that workload is correct. The solution isn't always to add the suggested index. Sometimes it's to adjust the code to improve the workload.There are no bugs - only undocumented features.0 -
Thanks for your reply. I will first investigate if that workload is indeed expected/correct.
If that IS the case, would it suffice to add a NAV-key on the fields [Schedule] ([Employee Role],[Duty Option] and ignore the fields after INCLUDE?0 -
Adding the NAV-key would likely help. The INCLUDE avoids the need for SQL to retrieve the complete record to get the "non-key" fields. Since they are "included" with the index.
Adding indexes(keys) helps reads and hurts writes. Considering how a table is used is important in deciding what (if any) keys to add or disable.There are no bugs - only undocumented features.0
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