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

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.

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