Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > CMS_Attachment table size View modes: 
User avatar
Member
Member
elsears-aol - 1/6/2013 9:19:04 AM
   
CMS_Attachment table size
Hello, we have uploaded just over 2 GB of assets to our kentico database (yes, it's a lot), but we are seeing that the table size (sp_spaceused) is upwards of 14GB. The 2GB figure is attained by summing the AttachmentSize column. What could explain this massive discrepancy? (It makes our backups quite unwieldy) We are using v6.0 (.57 I believe).

User avatar
Kentico Support
Kentico Support
kentico_radekm - 1/6/2013 10:09:17 AM
   
RE:CMS_Attachment table size
Hello.

First, there is an option to store files (i.e. their binary data) in the file system instead of database, which results in better performance and less-sized DB. You can see more details at http://devnet.kentico.com/docs/devguide/where_the_files_are_stored.htm.

As for size of your attachments table – do you use object versioning on your site?

Best Regards,
Radek Macalik

User avatar
Member
Member
elsears-aol - 1/6/2013 10:42:11 AM
   
RE:CMS_Attachment table size
Hi Radek, yes are currently looking into whether we should just move the storage off the database (there are pros and cons - so we are still evaluating).

Yes, we do use object versioning - but (and perhaps I'm just not familiar enough with the internals) I don't think we have been uploading new versions of the same assets that many times.

Perhaps you can explain a little bit more about the consequences.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 1/19/2013 8:37:08 PM
   
RE:CMS_Attachment table size
Hello.

I am not familiar with your particular setup, but maybe you simply modified parent file given attachment is connected to, so the version was created with original attachment.

However, maybe you could clarify what attachment type do you store to store these files? Please refer to http://devnet.kentico.com/docs/devguide/attachments_overview.htm

Also, there is an article which could help you with moving certain files/attachments from DB to file system and vice versa: http://devnet.kentico.com/Knowledge-Base/API-and-Internals/Moving-file-storage-from-database-to-file-storage.aspx

Best Regards,
Radek Macalik

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/4/2013 9:39:54 AM
   
RE:CMS_Attachment table size
@elsears if you have unlimited or nearly unlimited disk space AND you perform server backups, I suggest using file system over database for 2 reasons: 1) database size and performance. 2) file system image and file read performance is much faster.

Changing to file system only is as simple as unchecking the box in Site Manager, the CMS will do the rest (remove the binary data from the table). The nice thing is you can still search for those attachments because the CMS still stores some info about the files within the database.