DATE lookup table (1990/01/01:2041/12/31)

前端 未结 4 1827
抹茶落季
抹茶落季 2021-01-23 23:17

I use a DATE\'s master table for looking up dates and other values in order to control several events, intervals and calculations within my app. It has rows for every single day

4条回答
  •  星月不相逢
    2021-01-23 23:38

    This is a reasonable way of doing things. If you look into data warehousing, you'll find that those systems often use a similar system for the time fact table. Since there are less than 20K rows in the fifty-year span you're using, there isn't a huge amount of data.

    There's an assumption that the storage gives better performance than doing the computations; that most certainly isn't clear cut since the computations are not that hard (though neither are they trivial) and any disk access is very slow in computational terms. However, the convenience of having the information in one table may be sufficient to warrant having to keep track of an appropriate method for each of the computed values stored in the table.

提交回复
热议问题