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

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

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 -