Sql-server – Optionally exclude certain partitions using OLA’s scripts

insertola-hallengrenpartitioningsql serversql-server-2017

I have been using OLA's scripts for a long time and love them.

I have a very large database – 20+ TB with hundreds of partitioned tables.

I purge old data by dropping (merging the old partitions).

It is partitioned by date with weekly partitions going back about 6 months. I have to run daily index maintenance by partition to have any hope of keeping caught up (actually never catch up).

I am now on SQL 2017 and am trying ONLINE Rebuilds by Partition using the Resumable option.

What I find is every day I am rebuilding the current partition in almost every table only as it is always fragmented and likely will be fragmented tomorrow again due to massive # of inserts.

What I would like to do is exclude this partition.

This is the partition the current date falls in.

Ie, I would like to only rebuild past partitions.

Having this as an option would be very helpful.

Best Answer

Having this as an option would be very helpful.

Ola's scripts are now on github and a Feature request is already there.