Home > Articles > Data

  • Print
  • + Share This
From the author of

Tips and Warnings

  • Oracle has some slight bugs that affect calculations with BC dates.

  • Arithmetic on dates is slower than arithmetic on integers. If the only date calculations that you do involve number of days, and if you do a lot of arithmetic, it is cheaper to store Julian Day Numbers rather than DATE values. This tip is useless for Informix, SQL Server, or Sybase because their internal formats have something like a Julian Day Number anyway (as a signed integer with January 1 1900 equal to 0).

  • Although the Big Eight DBMSs all have the same functionality for dates, the storage, value ranges, and calendar calculations differ. So, portability is always possible but is never smooth.

In our book, we give some reasons for preferring TIMESTAMP over DATE for most situations. Check out SQL Performance Tuning (Addison Wesley Professional, 2002) for more information.

  • + Share This
  • 🔖 Save To Your Account