hi everyone, as you can imagine from my recent threads, i'm messing with a test db in order to investigate indexes and SIFTs occupation/performance in a 4.01 sql database (45GB)
in "SQLIndex" thread i recently posted here, i learnt something about bookmark lookup on clustered indexes and some other stuff, therefore i started to take a look to table 17 (gl entry) indexes in NAV.
The first thing i noticed is that there isn't any clustered index for this table :? why?I expected to find "Entry No." field as a clustered index, but it's not so...
I have also taken a look at "key" system table and i found that only 15 tables have a clustered index (12 of them are not standard tables)... :-k
As i couldn't see any note about the disabilitation of the CI, i tried to restore a std 401 database on my pc...No CI at all in the restored database (note that i restored the .fbk file of the product CD).
My first thought is: should i attach the mdf file instead of restoring the .fbk on a newly created SQL Database?
My second thought is: does the .fbk file ships the clustered indexes out of the box?
Thanks in advance!
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog0
Answers
the solution was in my hands!Thanks mibuso another time! (i couldn't find this topic with search...maybe it was at page 4 or so...)
http://www.mibuso.com/forum/viewtopic.php?f=7&t=11653&hilit=clustered
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
In NAV 4 this flag is usually not set, but the CI exist anyway (except for one early NAV 4.0 version - there was indeed a bug).
You could search for "Heaps" (= tables without CI) in SSMS using this query:
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
AFAIK this db was firstly created in 4.0 and then tech upgraded to SP1 (i am not sure because this customer had navision before i could even think than nav exists )
obviously, my "older" colleagues are on holiday
there are about 1000 heaps and about 260 clustered (indid=1)
i think there's a bug
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Once I created a little CU (50101) to fix this - please find it herwith.
Here I'm using a Timer-Control to set the CI in batches, allowing to COMMIT inbetween (else NAV would handle all in one HUGE transaction).
Please check it out! (No warranty, No guarantee, No support - USE AS IS)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I've read an advice somewhere that all tables in MS SQL better have a clustered index (though it does not have to be the primary key of a table but usually it is its primary key). The reason for that was the way MS SQL handles tables that have no clustered index - as table is modified frequently MS SQL creates too many pointers from one place to another without "compacting" the index.
What is clustered index ? - it is the index that tells MS SQL to physically save data in the order of that index. Well it does not mean all records are physically saved in the order of that index but it means the chunks of records (clusters) each have records saved physically in the order of the index though each chunk/cluster can be at any place on the disc so chunks themselves do not go one after another in the order of the index. Still it helps alot to read and find data by cluster index very fast.
I can't get the point of your post... :-k you're right, but i've never asked it...i know what is a clustered index and i know that nav tables should have it...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
EDIT: from nonclustered to clustered: from 40GB to 9GB
from "all buckets on" to "less buckets on" (and also rebuild of sift in order to avoid the bug in calculation): from 9GB to 4.5GB
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Without a CI the data is written overall in the database - wherever there's some free space, thus, you have - had- a maxium degree of fragmentation, hence, the objects allocate much too much space. Once this chaos has been organized, less space is consumed.
Further your example shows, how much crap-data is produced by standard SIFT structures ...
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool