A reader, January 07, 2020 - 7:00 pm UTC
Thanks Connor for your timely reply.
Its not actual table name, but columns are. Table have multiple columns, for illustration only showing the relevant ones.
Right i am using epoch time "seconds since 1970" in time columns. 1578421055 which is equivalent to Tuesday, January 7, 2020 10:17:35 AM GMT-08:00.
This table is used for Operational purpose i.e., "select" only to find the historical data. Records are inserted in those history tables after delete on the base tables, though there is no FK, all managed by application.
And luckily there would not be any row movements because of reasons explained above.
There are months have 31 days. So "interval(2592000)" will not work perfectly.
yes we will do "select" based on last_update_time.
January 08, 2020 - 1:00 am UTC
There are months have 31 days. So "interval(2592000)" will not work perfectly.
Neither does using a number for a date :-)
If you want accuracy to the month level, then you need to explicitly nominate each partition boundary....that is the cost of not using the right datatype.
You *could* get the precise months using the virtual column approach, but since you are selecting on last_update_time, you lose the benefit of partition elimination in this case.