Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

While a page is uncustomised (previously known as unghosted) it is stored on the file system, however once it is customised (previously known as ghosting) it is copied to the DB. Source 1 and Source 2

What I would like to understand is how SharePoint handles the versions of the customised pages within the database?

My understanding is that major versions are stored entirely, i.e. all the page data is stored in a single record, while with minor versions only the difference is stored. When a page is requested it gets the latest major version and takes each minor version after that and applies the changes until it has the latest version of the page.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

SharePoint will store the full copy of any document/page for each version of that document/page. In some cases (as with Wiki pages), SharePoint will highlight content to show what changed from version to version, but with documents and pages, the entire file is stored in the content database. This is why storing multiple different versions of large documents contributes so rapidly to content database size.

Please see the Technet guide on Enterprise Content Storage Planning for more information.

Excerpt:

In a large-scale authoring environment, for example, a site can contain a library in which users edit 50,000 or more documents across 500 or more folders. Versioning is enabled, and typically multiple versions of each document exist. Documents are checked in and out frequently, and workflows are used to control their life cycles. A typical database for this kind of site contains approximately 150 gigabytes (GB) of data. Library settings can be used to limit the number of versions saved, reducing database consumption. (Note that each version of a document is stored separately in the database.) Typically, in a large-scale authoring environment, 80 percent of site users are authors who have access to major and minor versions of documents, whereas 20 percent of site users have read-only permissions and can only view major versions of the content.

share|improve this answer
    
Awesome thanks :) –  Robert MacLean Jun 5 '12 at 13:21

SharePoint always stores the full file. It never tries to do diffs.

I haven't seen it documented regarding Site pages anywhere but if you ON A DEV BOX tries this:

Create a new Team site with relative url "Team"
Modify Home.aspx in SharePoint Designer Turn on Major/minor versioning of "Site Pages"
Check out Home.aspx Modify Home.aspx in SharePoint Designer

Run the following Select against the content database:

SELECT [Id]
      ,[DirName]      
      ,[LeafName]
      ,[InternalVersion]
      ,[UIVersion]
      ,[UIVersionString]
  FROM [dbo].[AllDocs]
  Where DirName = 'Team/SitePages'

You get a result like: enter image description here

Now run a new select using the Id you got for the modified page:

SELECT TOP 1000 [Id]
      ,[InternalVersion]
      ,LEN([Content])
  FROM [dbo].[AllDocStreams]
  WHERE [Id] = '3880A14D-0E7A-4B8E-820A-038A40C5DE20'

You get a result like this where you can see that the content of the new minor version is similar to the major version except for the changes made (in my case I added a space): enter image description here

share|improve this answer
    
Thanks, do you have any source for this information? –  Robert MacLean Jun 5 '12 at 12:23
    
As Per wrote, this is not documented. But the screenshots from the database clearly proves this to be true :-) –  Anders Rask Jun 5 '12 at 13:02
    
Awesome thanks :) –  Robert MacLean Jun 5 '12 at 13:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.