What should be my initial database size?

I am moving the database from MySQL to SQLServer. When creating a database, why should I set the initial size? I know that the size of the imported database will be about 130 MB, but it will grow. Should 130MB be the initial size, or should I just take the default value of 2MB?

+3
source share
5 answers

You must make the right size to fit your data, you will get a performance hit when the file should grow.

It depends on how fast it grows, I would say that 150 MB with a 10% self-heating.

MSDN, .

+2

, , , , . - :

: 150 ( 200 , )

Autogrowth: yes

: 5 25 ( )

+2
USE MASTER;
GO
CREATE DATABASE StackOverflowDatabase
ON 
( NAME = 'StackOverflowDatabase',
    FILENAME = 'C:\Program Files\Microsoft SQL Server\Your version\MSSQL\DATA\SO_db.mdf',
    SIZE = 200MB,
    MAXSIZE = UNLIMITED,
    FILEGROWTH = 50MB )
LOG ON
( NAME = 'StackOverflowDatabase_log',
    FILENAME = 'C:\Program Files\Microsoft SQL Server\Your version\MSSQL\DATA\SO_db.ldf',
    SIZE = 20MB,
    MAXSIZE = 50MB,
    FILEGROWTH = 10MB ) ;
GO
+1

200 50 - . tempdb , , , . , , 130 , , . , 200 , , , DBs, .

0

, , - , .

(, 1 /)

MDF

200

100 ( 50% )

LDF

20-50 ( 10-25% MDF)

10-25 ( 50% LDF )

% , . , , 300 , 30 . 500 , 50 . , MB, , .

0

Source: https://habr.com/ru/post/1753939/


All Articles