Calculating Storage Requirements for SQL-Server CE
I've got data potentially 开发者_如何学运维to be pushed to SQL-ce on a 3rd party windows phone application but I don't have anywhere to conduct a test so I need to figure if we'll exceed the 4Gb max database size (many millions of records).
I know the sizes of various data types but are there additional requirements for indexes, row id's, etc. Also this data will need to be synchronized/replicated so I assume every row needs a GUID or the like as well?
Table1 (first 2 fields are clustered primary key) nvarchar(20) int int datetime
Table2 (First field is primary key) int int datetime
Table3 (First two fields are clustered primary key) int int int
I have access to Sql Server (not CE) but I'm an Oracle guy and don't know my way around there very well. Any help or insight is appreciated.
This will be a starting point: http://support.microsoft.com/kb/827968 I have command line tools to migrate from SQL Server to SQL Compact, that will give you more rprecise results: http://exportsqlce.codeplex.com Also, Merge replication adds columns and system tables to your database.
Luckily your tables are very narrow, so the 4 GB can be stretched to a ton of rows. Every row will need a GUID, you're correct. Look into SEQUENTIALID, which will keep your records in some sort of order, reducing some performance hindrances of GUIDs. Do you currently have access to the data, or do you have a rough estimate of how many records you'll be storing? If you have the data I'd create a clean DB, create your tables and insert it. Index it to your liking and check the size. Indexes can take up quite a bit of space, but you shouldn't need much in the way of indexes on these narrow tables.
精彩评论