Skip to main content

key Impact on Database Size.

Hi All,

I am not sure about the article that I am writing that I Should Write it or not. The area that i am about to discuss is something where I am a newbie and would like to explore the area.

The Reason behind article was something asking a query about database size based on keys.

In this article we will see by a small demo how much the database size get increased based on No. of Keys that we have in one table.

Step 1 - Create a Blank Database in SQL & Create a Table in SQL which is same as Navision Item Ledger Entry with only one key.
The Table that is created is same as of Navision Item ledger Entry as shown below.

Step 2 - Check the Database Size before we start inserting Records in table. The Database Size as of Now is 2.27 MB.

Step 3 - Now lets copy records from Standard Cronus Database Looping it 100 times using SQL Query as shown below.

Step 4 - Let's check the database size again and see how much it have grown. The Database Size Now is 15.09 MB.

Step 5 - Let's see What was the Execution plan of the query that we ran in Step 3 to understand how records were inserted.

Step 6- Now i delete that database, Created a New Database but this time Item Ledger Entries have Same Keys as of Navision.

Step 7 - The Database Size as of Now is 2.27 MB. Now i will use same query to insert same no. of Records in the New Table Created with all keys that Navision Have. After execution of Query below is the Database Size that is 71.15 MB.

Step 8 - And Below is the execution plan of the Insert Query that we executed.

I was amazed to see the results when i executed these steps. I am not sure but i guess i can conclude that keys increases the database size as in SQL Data get stored in a sorted manner per key wise.

Below is the Power point of the above discussion.


Hope i made a point. If there is something wrong do let me know in comment sections. Your feedback and comments will motivate me to write more about SQL w.r.t Navision.

Queries can be found on my SKYDrive.

File Name - Key Impact.rar

** The table used in the query are based on Cronus India Database. If you are try to use the same query on different country then remove the Indian specific fields which will be highlighted in red when you copy in SQL Query window.

Saurav Dhyani


Popular posts from this blog

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

Error After Restore SQL Backup of NAV 2013 Database

Hi all, we are facing a conman issue during restoring a SQL Database backup restored for NAV 2013. While Trying to run object from Object Designer we get below listed error (even the service is configured properly) - --------------------------- Microsoft Dynamics NAV Development Environment --------------------------- There are no NAV Server instances available for this database. You must ensure that a NAV Server instance is running and is configured to use the database before you perform this activity. --------------------------- OK    ---------------------------

Future - What Next After NAV 2016. Code Name - Madeira...

Hi All, While Browsing web I came across some article which says about next release of Microsoft Dynamics NAV. Let's see the History of Code Names Given to Previous Version  - NAV 2013 - Code Name 'Sicily' NAV 2015 - Code Name 'CRETE' NAV 2016 - Code Name 'CORFU' And as we all know that all these are the Islands.