When I read through the manual it says first that SQL server updates these statistics (for SQL Query Analyzer) on a regular basis, then at the end it says you have to schedule it yourself, which one is it?
Also is this the same as the navision optimize which update statistics for the info? database->info->tables->optimize ?
Navision developer
0
Comments
It is not the same. Optimizing in Navision for example deletes 0-values from SIFT-tables and some other things to optimize.
Update statistics is done for another thing.
E.g.
Table 32: you have an index "Item No." and another index "Document No."
You have table T32 and you have a filter on "Item No." and another on "Document No.". So which index is the best? This depends on the data in the table. If you have a document no. that goes down to 1000 records and "Item No." that only has 10 records, index "Item No." is better. If it is the other way around (mostly it is), index "Document No." is better.
With the SQL-statistics, SQL knows what possibly is the best index to use. So it is necessary to update it regularly.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I am getting a bit confused about the keys in Navision SQL option though. I read somewhere that boolean and options are fields you do not want as keys in a Navision SQL option environment since they SQL want a field that is more or less unique.
However, if SQL Query analyzer decides what index to use, it can't matter much if I use these cause SQL Query analyzer will decide whether to include these or not? Maybe this with option and boolean only applies if I use MaintainSQLIndex on the selected key?
When you program navision to use a certain key, SQL Server interprets that as that it needs to order the dataset in the order of the fields in the key. This is separate from retrieving the data. SQL Server will analyze the filters and decide how to retrieve the data most efficiently.
RIS Plus, LLC
Is there a way to schedule the Navision optimization too?
SQL chooses the index for data retrieval based on selectivity.
Selectivity is the percentage of rows returned by a query using a given index. The higher percentage means a lower selectivity. A query is considered to have high selectivity if it returns less than 5% of the rows in the table. The query optimizer will most likely use this index. When selectivity is between 5% and 10% the query optimizer may or may not use the index. When the selectivity is above 10% the query will rarely use the index. If there is not a better index available a table scan will be done.
In this case you should maintain SQL indexes for all high selectivity keys, and for your keys in Navision with low selectivity you uncheck the MaintainSQLIndex checkbox. That way your Navision code will still recognize the key, and SQL Server will return the recordset ordered in the right order.
This is not exact science, you will probably try it a few times before you get it right.
RIS Plus, LLC
Have a nice weekend!
Could you send it to me please? I'll pm you my email.
But you have to log in.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
The company I work for is using Navision but currently have no maintenance contract with any NSC.
How do we get the resource kit?
Can't we just activate the "Auto update statistics" option on database properties on EM ?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
RIS Plus, LLC
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thank you for your direction...i'm downloading it now...