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.

Regards,
Saurav Dhyani

Comments

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    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

Dynamics NAV - All that you need to know about MenuSuites.

Hi Readers, This article is based on a request from a blog reader who wanted to understand about MenuSuite in Dynamics NAV. If you have started working with Business central with AL Code then it does not apply to those releases but if you are interested go ahead. Let's start with Future - In Latest and greatest version of product MenuSuite are obsolete and no longer used. So this article applies if you want to learn about C/AL MenuSuite.