Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3287

Nanoseconds in MariaDB ColumnStore

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: Icebox
    • Component/s: DDLProc
    • Labels:
      None

      Description

      Nanoseconds in MariaDB
      ----------------------------------------
      Currently we have Microseconds in MariaDB

      https://mariadb.com/kb/en/library/microseconds-in-mariadb/

       
      MariaDB [test]> SELECT CAST('2009-12-31 23:59:59.9876543210' as DATETIME(6));
      +-------------------------------------------------------+
      | CAST('2009-12-31 23:59:59.9876543210' as DATETIME(6)) |
      +-------------------------------------------------------+
      | 2009-12-31 23:59:59.987654                            |
      +-------------------------------------------------------+
      1 row in set, 1 warning (0.000 sec)
       
      MariaDB [test]> SELECT CAST('2009-12-31 23:59:59.9876543210' as DATETIME(10));
      ERROR 1426 (42000): Too big precision 10 specified for '2009-12-31 23:59:59.9876543210'. Maximum is 6
       
      MariaDB [test]> SELECT CAST('2009-12-31 23:59:59.9876543210' as DATETIME(9));
      ERROR 1426 (42000): Too big precision 9 specified for '2009-12-31 23:59:59.9876543210'. Maximum is 6
      
      

      Nanoseconds in MariaDB

      It ranges from 0 to 9, meaning that we can use the TIMESTAMP data type to store up to nanosecond. Currently MariaDB support fractional seconds precision sets to microsecond.

       
      MariaDB [test]> SELECT TIME'10:10:10.1234567890';
      +---------------------------+
      | TIME'10:10:10.1234567890' |
      +---------------------------+
      | 10:10:10.123456           |
      +---------------------------+
      1 row in set, 1 warning (0.001 sec)
      
      

      For example :-

      I have two timestamps i.e. start= 15-03-11 15:10:10 and finish=15-03-11 15:10:10 and i need to subtract them ("finish-start" ) in order to find the duration.

      Because their difference is in nanosecond level, I need to have them into 15:10:10.000000001 and 15:10:10.000000015 respectively.

      TIMESTAMP [(<nanosecond precision)]
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              toddstoffel Todd Stoffel
              Reporter:
              toddstoffel Todd Stoffel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.