SETCURRENTKEY with SETRANGE and SETFILTER

jordi79
Member Posts: 280
Hi,
I know in the old NAV before NAV2009, SETCURRENTKEY is called before SETRANGE/SETFILTER to improve filter performance. Does this still stand true for later versions of NAV? NAV2017? NAV2018?
Jordi
I know in the old NAV before NAV2009, SETCURRENTKEY is called before SETRANGE/SETFILTER to improve filter performance. Does this still stand true for later versions of NAV? NAV2017? NAV2018?
Jordi
0
Answers
-
No, in later versions of NAV, MSSQL determinate the best index. SETCURRENTKEY is useful for sorting the data in specific way only.0
-
SETCURRENTKEY had a dramatic impact in NAV installations running on native database, which was possible up to the latest release 2009 R2 including Classic Client.
The SETCURRENTKEY still has some impact on performance in SQL Server based installations, in old versions using Classic Client, and in all versions using RTC. This is because SETCURRENTKEY determines the order in which the result will be returned, which in turn has an impact on what index SQL Server picks up for filteing. To recap - yes, SETCURRENTKEY still has an impact on filtering performance.
The best is always to do some tests on a large data sets. When a table has a just few thousands of records indexing/ordering does not make much difference.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Hi,
I know in the old NAV before NAV2009, SETCURRENTKEY is called before SETRANGE/SETFILTER to improve filter performance. Does this still stand true for later versions of NAV? NAV2017? NAV2018?
Jordi
Yes It has Impact.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
Hi,
I am sorry but I am not sure that it really impact the performance. I perform a test on the Item Ledger Entries, retrieving all records where the posting date >= 010318D (=755338 records).
1. without setcurrentkey 18157 ms / 18219 ms / 18000 ms
2. with setcurrentkey("Posting date") -18125 ms / 17922 ms / 17973 ms
Regards,
Michael0
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