sql-serverdatabase-designazure-sql-databasetable-partitioning

Is it a good practice to reuse partition functions and schemas on SQL Server Azure between different tables?


I have a partition function and a partition schema by date that I'm already using on a big table on my DDBB. As I have several big tables in my database that share this common pattern of having a date column, I wonder if it's OK to reuse this partition function & schema among them or if otherwise it's better to create a separate pair of partition function & schema for each table to be partitioned on the database.


Solution

  • Like all things SQL Server, "it depends".

    Sharing partition functions/schemes among different objects is ok when partition maintenance for all referencing objects is performed on the same cycle and planned accordingly. In cases where partitioning is leveraged to efficiently purge/load data by date, those processes need to be coordinated to avoid conflicts.

    I usually create a separate function/scheme for each object except in cases where maintenance will be always be performed in tandem, such as related tables of a single application.