SELECT SUM("s2") FROM "NavisionSP2$50000$0" WITH (READUNCOMMITTED) WHERE (bucket=? AND ((f3>=? AND f3<?)))
setrange(Date,010107D,123107D);
SELECT SUM("sum1") FROM (SELECT SUM("s2") AS "sum1" FROM "NavisionSP2$50000$0" WITH (READUNCOMMITTED) WHERE (bucket=? AND ((f3>=? AND f3<?))) UNION ALL SELECT SUM("s2") AS "sum1" FROM "NavisionSP2"."dbo"."NavisionSP2$50000$0" WITH (READUNCOMMITTED
It looks like you should set closing date in your filter for dates?
Will this have perfomrance Improvement? Looks like the second statement does a Union whereas the first doesn't.
Yes I created a 50000 table to play and learn. With Line No. as PK and Date and amount field.
Something else I just saw that was mentioned in webcast was example of table that can gain performance. "Warehouse Activity Line" was one of them.
Anyways. Another tip I want to add is that. Since 5.0 has sql performance changes already added to the object, if you want to improve performance, Just compare the 5.0 table keys to 4.0. They've added different SQL Index to the keys and have disabled MAINSQL Index on several keys.
Make sure that you don't change Navision keys, just the sqlindex.
ok I've now started query analyzer and looked at the following sql statement
SELECT *,DATALENGTH("Picture") FROM "NAVPROD"."dbo"."Jason Pharm$Contact" WHERE (("Name" LIKE 'test')) AND "No_">'C100020' ORDER BY "No_" OPTION (FAST 10)
There are two keys on Contact table
"No."
"Name","No." <---- new key added by me.
Based on execution plan both keys have 50% percent chance for the above.
I added the key because users constantly running this query on production.
In SQL the query analyizer shows the following code
SELECT *,DATALENGTH("Picture") FROM "NAVPROD"."dbo"."Jason Pharm$Contact" WHERE (("Name" LIKE @P1)) ORDER BY "No_" OPTION (FAST 10)
I can't tell what P1 is and P2. Is there a way I can find out?
If I change the value of P1 and P2 I get different percange 68% - 32%.
The Primary clustered key wins most of the time.
In query analyzer this shows a duration of 700 ms.
There are 150K Contacts records in the table.
is 700 ms too high? Will the new key bring any benefits if I add it to production?
Users are constantly searching for contacts on contact card.
Answers
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
See you in Belgium \:D/
(PS: This is not a SQL Workshop location)
setrange(Date,010107D,CLOSINGDATE(123107D));
setrange(Date,010107D,123107D);
It looks like you should set closing date in your filter for dates?
Will this have perfomrance Improvement? Looks like the second statement does a Union whereas the first doesn't.
Something else I just saw that was mentioned in webcast was example of table that can gain performance. "Warehouse Activity Line" was one of them.
Anyways. Another tip I want to add is that. Since 5.0 has sql performance changes already added to the object, if you want to improve performance, Just compare the 5.0 table keys to 4.0. They've added different SQL Index to the keys and have disabled MAINSQL Index on several keys.
Make sure that you don't change Navision keys, just the sqlindex.
This can be very helpfull.
So my final answer as they would say in jeopardy. Who is Hynek?
Hynek is manager of SQL Perform Ltd, a company specialised in SQL tuning for NAV.
The answer to your question is yes, even MS is hiring him for his knowledge.
Please look at www.sqlperform.com
Also how much performance degradation is there when running sql profiler on a database? Is it noticeable. If lets say there are 20 people loged in?
There are two keys on Contact table
"No."
"Name","No." <---- new key added by me.
Based on execution plan both keys have 50% percent chance for the above.
I added the key because users constantly running this query on production.
In SQL the query analyizer shows the following code
I can't tell what P1 is and P2. Is there a way I can find out?
If I change the value of P1 and P2 I get different percange 68% - 32%.
The Primary clustered key wins most of the time.
In query analyzer this shows a duration of 700 ms.
There are 150K Contacts records in the table.
is 700 ms too high? Will the new key bring any benefits if I add it to production?
Users are constantly searching for contacts on contact card.
Click on window, uncheck autscroll.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!