I've created a view which joins Item, Item Variant and Stock keeping unit tables.
When running it from SQL 2005, the performance seems ok but from the object designer you can almost see each record being fetched.
Has anyone else experienced the same issue?
(System is based on NAV 5 sp1)
Thanks
Simon
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Does that mean there is nothing I can do to influence performance - I was wondering if I should have a simple primary key?
Simon
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
exist for the fields that you "join" from the 3 other tables there indexes so that the datas can be found fast?
I have tested all this with a really simply view. Just to see how it all works.
Basically:
1) I have a field on the vendor table
2) I select all records of type Order or Invoice from the purchase line table WHERE
3) "Buy from vendor no." is in Vendor table WHERE
4) The field on my vendor table is blank
Seems very simple. I ran it on my test system and its lovely. So lovely that reading a table in company1 from company2 is faster this way than using a CHANGECOMPANY and applying the same filters.
I ran it on my LIVE system and it crawled.
After much searching I found that for someone reason SQL is selecting index $13 in test and $14 in live (when reading the Purchase Line Table) Even if I clear caches and all this appears to remain.
SO HERE IS MY QUESTION:
In the select statement I added a "WITH INDEX $13" type command and it worked lovely. However when I try to move this into my VIEW I am told that WITH INDEX can not be used in Views.
Am I doing something wrong, is there another option, or can I simply not use this select statement, which normally works, inside the code of a view?
Here is essentially the code I am using:
You can see where the WITH INDEX is, which works as a normal SELECT but not in a VIEW.
Also, I've spotted that NAV 2009 sp1 seems much better with views.
Yea there are likely reasons why the bad stuff is happening and I am looking into that too. I hope to find it. However the main question I have here is how to do a WITH INDEX in the SQL statement. I just can not seem to work it and I would like to solve that one in parallel to the main issue too. Not just because it will also solve the problem, but because its a question I do not have the answer to and I hate those
Gavin
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!