.net - shrink or compact in Sql Server CE? -


I am using Visual Studio 2008. And I'm new on sqlce. I am checking the SDF file and if the SDF is not present, then I create and then insert 5000 rows in my SKD. If SDF is present, then first I remove the rows of all the tables and then put these records in the existing tables. After joining, I am compacting the database. By the way, compacting lasts for about 13 seconds. I know that there is a way that calls briefly. Shrink and compact DB make small but which of these should be used in this scanner? How can I do compact less time? I do not need to back up the SDF and after the compact, I read the topic removing the old SDFI, but I can not decide whether I should use it.

please see:

Excerpt from:

SqlCeEngine / ISSCEEngine: Wide Compact Summary The difference between the two is very similar to internal and external memory fragmentation

From

to:

By transferring empty and unallocated pages at the end of the file, empty space in the database was empty, and then the file was truncated. You can configure the database to automatically shrink by setting up the AutoRing Threshold option in the connection string. Shrink does not make a temporary database file. From:

From:

An empty database is provided blank in the database by creating a new database file from the existing file. Creating a new database means that it retrieves the space between rows.

To be more clear, shrink those that are completely free or unblocked, claim those pages; Where as well, compact also claims in the page with wasted space. Therefore, compact needs to create a new database file.

The blank space in the page may result in the following:

1) If there were 5 rows in one page and two of them have been removed

2) If there is a line in the middle of the page which requires more space on the update, then the page has exited (ex: Narcotical Column Update)

In the blank page and unallocated page database The result of one can remain as:

1) Not all rows in one page

2) The entire table has expired


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -