← Back to team overview

maria-discuss team mailing list archive

Re: [Maria-developers] Microseconds support in MariaDB 5.3.



By default, the existing precision is used. Only if a column is defined as TIME|TIMESTAMP(N) with N being either 3 or 6 , then millisecond or microsecond precision will be used.

Philip Stoev

----- Original Message ----- From: "Peter Laursen" <peter_laursen@xxxxxxxxxx> To: <maria-discuss@xxxxxxxxxxxxxxxxxxx>; <maria-developers@xxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, September 21, 2011 5:33 PM
Subject: [Maria-developers] Microseconds support in MariaDB 5.3.

I noticed: http://askmonty.org/blog/the-2-year-old-mariadb/ "The support for
microseconds in TIMESTAMP, DATETIME, and TIME".

I fully agree the 'full seconds support only' has been a sever limitation in
MySQL. But I have two concerns with ths:

'noisyness'. On not very fast systems the last digits of a TIME in
microseconds should not be considered too much important.  It depends on
what else the system is doing at the time. I think for lots of users
milliseconds and not microseconds would be better/more relevant. It is not
always a lot of digits can be proven true.  When we went to school we were
all taught not to present results in natural sciences more accurate than the
accuracy of data sources and measurements. Providing too many digits in a
resuslt actually caused a lower score in my highschool!

Compability. There is a problem with UPDATES. A client/application written
for MySQL may assume 'full seconds support only' and may generate the
current MySQL format byte format in the WHERE clause (typically if the
client reserves a 14 byte buffer for TIMERSTAMPS etc).  In SQL:

UPDATE table SET column = 'something' WHERE  time_column = '01:01:01':
.. this update will fail if the currently stored value is
'01:01:01:010001'; and the rigth query in the context would be.
UPDATE table SET column = 'something' WHERE  time_column =

Ideally I think there should be a configuration parameter and a global
variable to SET time_accuracy = full_second|millisecond|microsecond.

Did somebody have considerations about same? I definitely think that lots of
applications using a TIME|TIMESTAMP|DATETIME column in the WHERE-clause of
an UPDATE statement will need some rewrite to be upgradable to MariaDB 5.3

-- Peter


Mailing list: https://launchpad.net/~maria-developers
Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Follow ups