How are non-deterministic functions used in SQL partitioning functions and are they useful?
How are non-deterministic functions used in SQL partitioning functions and are they useful?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MsSql allows non-deterministic functions in partitioning functions:
Does that mean that records older then 10 days are automatically moved to the archive (first) partition? Of course not.
The database stores the date when the partitioning schema was set up and uses it in the most (logical) way. Lets say one sets the above schema on 2000 -01-11 which makes the delimiting date 2000-01-01. When you are querying for data with date lower then the initial delimiting date (boundary_value – 2000-01-01) you will use only the archive partition. When you are querying for data with date higher then the current day minus 10 days (GETDATE() – 10) you will be using only the current partition. All other queries will use both partitions ie querying for data with date lower then current date minus 10 days but higher then the delimiting date (2000-01-01).
This means that with each passing day, the range of dates for which both partitions are used is growing. And you would have been better of setting the partition to the delimiting date deterministically.
I don’t forsee any scenario where this is useful.