Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8320

Allow index usage for DATE(datetime_column) = const

Details

    • 10.2.2-2, 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-3, 10.2.2-4, 10.2.3-1, 10.2.3-2

    Description

      Would it be possible to make DATE() on datetime column sargable in some cases?
      Like rewrite "DATE(col) = const" to "col BETWEEN concat(const, ' 00:00:00') AND concat(const, ' 23:59:59')"

      Other similar cases:

      • "YEAR(col) = const" is almost the same
      • "YEAR(col) = c1 AND MONTH(col) = c2" and other such combinations may be too complex to be worth it.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Alexey Botchkov made transition -
            Open In Progress
            406d 2h 35m 1
            Alexey Botchkov made transition -
            In Progress Stalled
            1d 18h 51m 1
            Oleg Smirnov made transition -
            Stalled In Progress
            1898d 15h 17m 2
            Oleg Smirnov made transition -
            In Progress In Review
            79d 3h 24m 2
            Sergei Petrunia made transition -
            In Review Stalled
            448d 6h 59m 2
            Sergei Petrunia made transition -
            Stalled In Testing
            25m 53s 1
            Lena Startseva made transition -
            In Testing Stalled
            35d 20h 6m 1
            Oleg Smirnov made transition -
            Stalled Closed
            11h 1m 1

            People

              oleg.smirnov Oleg Smirnov
              jkavalik Jiri Kavalik
              Votes:
              5 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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