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

SQL PARSER - unsigned number optimization - could return Impossible Where

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • Labels:

      Description

      Hi guys, i found a optimization (maybe a bug?) that could be 'easly' optimized, check this query...

      CREATE TABLE A (I INT UNSIGNED);
      INSERT INTO A VALUES (1),(2),(3),(4)
      EXPLAIN
      SELECT COUNT(*)FROM A WHERE I<0
      

      this return 4 rows...

      but since "I" Column is unsigned it could return IMPOSSIBLE Where, right? (-1 don't exists to unsigned...)

      i'm thinking about this optimization, and this other optimization (MDEV-4419) could allow some (many) queries to run faster

      in SHOW STATUS LIKE 'handler_re%'
      i see 4 rows being read when i execute the <0 query
      in other words, it's reading data from disk (maybe a bug in optimizer)

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                rspadim roberto spadim
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: