Use the “Date” datatype rather than “Int” datatype.

Int (formatted in YYYYMMDD) used to be the recommended format for partitioning, as it was cheaper (@ 4 bytes/row) than datetime (@ 8 bytes/row). Date is 3 bytes/row and is in a natural date format. Also, INT is a pain in the butt to query on as you have to add conversions in your’ search arguments.

Recommendation: Use “Date” date type for partition column.

Sources:

https://dba.stackexchange.com/questions/50774/partitioning-by-datetime-vs-date-vs-int-performance

Last modified: May 17, 2021

Author

Comments

Write a Reply or Comment