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

Allow index usage for DATE(datetime_column) = const

    XMLWordPrintable

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

            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.