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

SQL PARSER - unsigned number optimization - could return Impossible Where

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None

    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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            rspadim roberto spadim
            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.