Tim Soderstrom wrote:

On Dec 29, 2008, at 9:11 AM, Jay Pipes wrote:

From the MySQL Manual:

http://dev.mysql.com/doc/refman/5.0/en/time.html

"MySQL retrieves and displays TIME values in 'HH:MM:SS' format (or 'HHH:MM:SS' format for large hours values). TIME values may range from '-838:59:59' to '838:59:59'. The hours part may be so large because the TIME type can be used not only to represent a time of day (which must be less than 24 hours), but also elapsed time or a time interval between two events (which may be much greater than 24 hours, or even negative)."

Question:

Does anyone use the TIME column type?

Yes. I use it to store song lengths. I assume the same holds true for people wanting to store videos, etc.

OK. So, basically, you are just using TIME as a presentation thing, right? TIME outputs automatically as HH:MM:SS, and that is good for your application?

If so, do you use the "large hours" ability to store hours > 23:59:59?

I haven't, but this came up once. Someone wanted to track the total length of time someone was logged in. And, in fact, it was thought that he might need MORE than 839 hours :) I wouldn't really say there's a huge need for this, however. Though, I would like to keep the TIME field. For storing reasonable lengths (again songs), it's wildly convenient.

What about storing the elapsed time in seconds in an integer column?

I'm looking to simplify the temporal column types and this is one type I believe may possibly be up for the chopping block, but certainly want to get people's opinion on it.

Well, since Drizzle is going to be pluggable, is this something that can be a plugin and simply be built from native storage types? Like human-readable IPv4 addresses, the underlying storage could just be an integer. When you store or call it, you could just automatically run a function to present it in a friendly way? That may be already what you are doing with the TIME field and I can't claim to be an expert but thought I'd throw that out there :)

Possibly. Right now, I'm just trying to simplify both the internal implementation of TIME and the external "weirdness" of the 838 hours thing...

-jay

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to