<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww" -->

---
title: MySQL Best Practice : not using date / time types, nor ENUM
description: A MySQL practitioner argues against using complex data types — specifically TIMESTAMP, DATE/TIME types, and ENUM — in favor of simpler numeric alternatives....
canonical: https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: MySQL Best Practice : not using date / time types, nor ENUM | daily.dev
og:description: A MySQL practitioner argues against using complex data types — specifically TIMESTAMP, DATE/TIME types, and ENUM — in favor of simpler numeric alternatives....
og:url: https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww
og:image: https://api.daily.dev/og/posts/aheRz8sWw.png
og:image:alt: MySQL Best Practice : not using date / time types, nor ENUM
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL Best Practice : not using date / time types, nor ENUM

**[Planet MySQL](https://daily.dev/sources/planet-mysql)** · 2 min read · 55 upvotes · 13 comments

## Summary

A MySQL practitioner argues against using complex data types — specifically TIMESTAMP, DATE/TIME types, and ENUM — in favor of simpler numeric alternatives. The case against TIMESTAMP echoes Baron Schwartz's classic advice to store epochs in numeric fields. Against ENUM, the post cites Booking.com's experience (removing a value requires a full table rebuild) and a newly discovered MySQL bug where MIN()/MAX() on ENUM operates on string values while ORDER BY uses position values, creating inconsistent behavior that worsens when a secondary index is added.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://jfg-mysql.blogspot.com/2026/07/best-practice-no-timestamp-nor-enum.html>

## Questions this post answers

### Does MIN() and MAX() on a MySQL ENUM column use the string value or the numeric position value?

MIN() and MAX() on an ENUM column operate on the string value, not the numeric position value used internally, while ORDER BY sorts by the position value instead. This inconsistency is documented in MySQL bug #121036, which shows that creating a secondary index on an ENUM column can even change the result returned by MIN()/MAX().

_Developers debating whether ENUM is safe for a schema can find this kind of gotcha flagged early on daily.dev._

### Why do some MySQL experts recommend avoiding the TIMESTAMP data type?

Baron Schwartz, a well-known MySQL contributor, compared using TIMESTAMP to running with scissors because of its complicated time zone handling, recommending storing epochs in a numeric field instead. The broader argument is that complex or high-level types like TIMESTAMP and ENUM are poorly understood even by people who think they've mastered them, and by their colleagues.

_Anyone weighing schema design tradeoffs in MySQL can track this kind of practical advice on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@christiansicari** · 14 upvotes

> If you can't use datetime in a DBMS, maybe you shouldn't use that DBMS

**@erikwurzer** · 5 upvotes

> Using enum in MySQL can reduce on disk storage, allows indexes containing them to be more effective (smaller memory footprint can result in more entries per page), and enables faster writes.
>
>
> But sure, let’s call out a documented behavior and then dismiss a functionality.
>
>
> Also of note: yes if you delete a value you have to rebuild. Not much else makes sense. You can also append new values instantly on any size table.

**@gresakg** · 5 upvotes

> Sure, don't use any complex tool because you don't fully understand how it works. Let's abandon computers and go back working land by hand ...

**@brunodebrito** · 2 upvotes

> ![GIF](https://static.klipy.com/ii/bea85337777ad0e23e63683391435543/30/30/WhFFZeht.gif)

**@agustinbarrientos** · 2 upvotes

> DATETIME still wins for me when people need readable timestamps, but ENUM gets uncomfortable once product states can evolve

## Similar posts on daily.dev

- [10 best practices for timestamps and time zones in databases](https://daily.dev/posts/10-best-practices-for-timestamps-and-time-zones-in-databases-xhfzsegaw) · Tinybird · 2 upvotes · 1 comments
- [PostgreSQL to SQL Field Notes: Date & Time](https://daily.dev/posts/postgresql-to-sql-field-notes-date-time-nx1bbpygh) · DevBlogs · 0 upvotes · 1 comments
- [Faster String Aggregations with Dimension Tables](https://daily.dev/posts/faster-string-aggregations-with-dimension-tables-eljteph2w) · DuckDB · 0 upvotes · 0 comments
- [Avoid UUID Version 4 Primary Keys](https://daily.dev/posts/avoid-uuid-version-4-primary-keys-5pot7xhqf) · Hacker News · 79 upvotes · 10 comments

---

Tags: [#database](https://daily.dev/tags/database), [#backend](https://daily.dev/tags/backend), [#mysql](https://daily.dev/tags/mysql)

[View this post on daily.dev](https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"MySQL Best Practice : not using date / time types, nor ENUM","url":"https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww"},"datePublished":"2026-08-06T23:24:49.259Z","dateModified":"2026-09-13T21:45:27.595Z","description":"A MySQL practitioner argues against using complex data types — specifically TIMESTAMP, DATE/TIME types, and ENUM — in favor of simpler numeric alternatives....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0080eb4fd567b2e99e4f22f2acf3d2b4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0080eb4fd567b2e99e4f22f2acf3d2b4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet MySQL","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet MySQL","logo":"https://media.daily.dev/image/upload/s--UKAtmXTq--/f_auto,q_auto/v1780213421/logos/planet-mysql?_a=BAMAMiWQ0","url":"https://daily.dev/sources/planet-mysql"},"commentCount":13,"discussionUrl":"https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":55},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":13}],"keywords":"database,backend,mysql","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet MySQL","item":"https://daily.dev/sources/planet-mysql"},{"@type":"ListItem","position":3,"name":"MySQL Best Practice : not using date / time types, nor ENUM"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww","comment":[{"@type":"Comment","text":"If you can’t use datetime in a DBMS, maybe you shouldn’t use that DBMS","datePublished":"2026-08-07T07:05:06.989Z","url":"https://daily.dev/posts/aheRz8sWw#c-8VPGZ0n7c","author":{"@type":"Person","name":"Christian Sicari","url":"https://daily.dev/christiansicari","image":"https://avatars.githubusercontent.com/u/29756552?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":14}},{"@type":"Comment","text":"Using enum in MySQL can reduce on disk storage, allows indexes containing them to be more effective (smaller memory footprint can result in more entries per page), and enables faster writes.\nBut sure, let’s call out a documented behavior and then dismiss a functionality.\nAlso of note: yes if you delete a value you have to rebuild. Not much else makes sense. You can also append new values instantly on any size table.","datePublished":"2026-08-07T14:05:28.536Z","dateModified":"2026-08-07T14:08:21.643Z","url":"https://daily.dev/posts/aheRz8sWw#c-a8rBVP4lM","author":{"@type":"Person","name":"Erik Wurzer","url":"https://daily.dev/erikwurzer","image":"https://lh3.googleusercontent.com/a/ACg8ocKY56taT6PPIlRKU0gdOP8Lnye4WzE1oBn8z8qa65rFFF0dds7F=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"Sure, don’t use any complex tool because you don’t fully understand how it works. Let’s abandon computers and go back working land by hand …","datePublished":"2026-08-08T06:36:08.199Z","url":"https://daily.dev/posts/aheRz8sWw#c-Lm4UtdPfO","author":{"@type":"Person","name":"Grergor","url":"https://daily.dev/gresakg","image":"https://media.daily.dev/image/upload/s--Mh3EhDVj--/f_auto/v1762860597/avatars/avatar_Z0Y5lKjimjGDZtplRmL1r?_a=BAMAK+ZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"","datePublished":"2026-08-09T01:14:30.016Z","url":"https://daily.dev/posts/aheRz8sWw#c-tLxksRJB5","author":{"@type":"Person","name":"Bruno de Brito","url":"https://daily.dev/brunodebrito","image":"https://avatars.githubusercontent.com/u/3311001?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"DATETIME still wins for me when people need readable timestamps, but ENUM gets uncomfortable once product states can evolve","datePublished":"2026-08-09T22:51:12.176Z","url":"https://daily.dev/posts/aheRz8sWw#c-fUe8n2SsN","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/mysql-best-practice-not-using-date-time-types-nor-enum-aherz8sww#faq","mainEntity":[{"@type":"Question","name":"Does MIN() and MAX() on a MySQL ENUM column use the string value or the numeric position value?","acceptedAnswer":{"@type":"Answer","text":"MIN() and MAX() on an ENUM column operate on the string value, not the numeric position value used internally, while ORDER BY sorts by the position value instead. This inconsistency is documented in MySQL bug #121036, which shows that creating a secondary index on an ENUM column can even change the result returned by MIN()/MAX(). Developers debating whether ENUM is safe for a schema can find this kind of gotcha flagged early on daily.dev."}},{"@type":"Question","name":"Why do some MySQL experts recommend avoiding the TIMESTAMP data type?","acceptedAnswer":{"@type":"Answer","text":"Baron Schwartz, a well-known MySQL contributor, compared using TIMESTAMP to running with scissors because of its complicated time zone handling, recommending storing epochs in a numeric field instead. The broader argument is that complex or high-level types like TIMESTAMP and ENUM are poorly understood even by people who think they've mastered them, and by their colleagues. Anyone weighing schema design tradeoffs in MySQL can track this kind of practical advice on daily.dev."}}]}
```

