SQL server number of data files per file group

Ashwan 536 Reputation points
2023-06-05T02:16:10.3166667+00:00

hi experts

on prem

SQL version : 2019

Virtual VM machines/ alwayson enabled

use it: OLTP system

We have large database over 1.5TB database on 10 datafiles . each 200gb aprox. could any one confirm any limitation or performance impact holding all data files on one file group? with the demand , keep creating more datafiles on single files group would be the best practise ?

thanks

SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2023-06-05T06:19:36.3266667+00:00

    We have large database over 1.5TB database

    Nowadays 1.5 TB isn't that very large and SQL Server can easily handle it if everything on data is in one database file.

    If it's located on a well performing SAN, then the count of database groups/file doesn't matter much.

    Keep it as it is now.

    2 people found this answer helpful.
    0 comments No comments

  2. ZoeHui-MSFT 41,491 Reputation points
    2023-06-05T06:43:09.7033333+00:00

    Hi @Ashwan,

    Please check the official documentation.

    Recommendations when working with files and filegroups:

    • Most databases will work well with a single data file and a single transaction log file.
    • If you use multiple data files, create a second filegroup for the additional file and make that filegroup the default filegroup. In this way, the primary file will contain only system tables and objects.
    • To maximize performance, create files or filegroups on different available disks as possible. Put objects that compete heavily for space in different filegroups.
    • Use filegroups to enable placement of objects on specific physical disks.
    • Put different tables used in the same join queries in different filegroups. This step will improve performance, because of parallel disk I/O searching for joined data.
    • Put heavily accessed tables and the nonclustered indexes that belong to those tables on different filegroups. Using different filegroups will improve performance, because of parallel I/O if the files are located on different physical disks.
    • Don't put the transaction log file(s) on the same physical disk that has the other files and filegroups.
    • If you need to extend a volume or partition on which database files reside using tools like Diskpart, you should back up all system and user databases and stop SQL Server services first. Also, once disk volumes are extended successfully, you should consider running DBCC CHECKDB command to ensure the physical integrity of all databases residing on the volume.

    For more information on transaction log file management recommendations, see Manage the size of the transaction log file.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.