Alter Partition split going on hang stat when inserting large set of rows in table in sql server 2016

Dharmendra Panwar 20 Reputation points
2020-12-23T07:47:39.423+00:00

Hi ,

We are inserting 30 M records hourly in partition table(partition on Insert date) using Java ETL(Multiple threads). Simultaneously We are creating future partition(>30 Days) using alter partition split via Jobs in sql server daily basis(1 partition every day). alter partition split is going on hanged/lock state sometime. Is there any other way to achieve future date partition or we can avoid this hang/lock issue. Please suggest.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,961 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dan Guzman 9,236 Reputation points
    2020-12-23T11:14:59.783+00:00

    Splitting the partition function will require a restrictive schema modification lock on the underlying tables/indexes during the process. Although the operation will be fast when no data movement is needed, the operation will be blocked by concurrent activity. All you can do is ensure data movement is not needed to accommodate the new boundary and schedule the partition maintenance around other activity.


1 additional answer

Sort by: Most helpful
  1. Guoxiong 8,206 Reputation points
    2020-12-23T15:03:55.647+00:00

    Make sure there are empty partitions at both ends of the partition range, which guarantees that the partition split doesn't incur any data movement.

    0 comments No comments

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.