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

Very slow query with CONVERT and REPLACE

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1
    • 10.1
    • None

    Description

      # Not using SEQUENCE table because I need it to work with MySQL too
      create table seq (`seq` bigint(20) unsigned NOT NULL, PRIMARY KEY (`seq`)) engine=MyISAM default charset latin1;
      insert into seq values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27),(28),(29),(30);
      SELECT * FROM seq WHERE REPLACE( CONVERT( '2008-02-01 17:10:46.040349' USING latin1 ), seq, '4846798216233746430' ) IS NOT NULL;
      

      30 rows in set (1 min 42.18 sec)
       
      MariaDB [test]> select @@version;
      +-----------------+
      | @@version       |
      +-----------------+
      | 10.1.12-MariaDB |
      +-----------------+
      

      MySQL 5.6.26 is also slow, but MySQL 5.6.28 is okay, apparently it was fixed:

      30 rows in set (0.00 sec)
       
      MySQL [test]> select @@version;
      +-----------+
      | @@version |
      +-----------+
      | 5.6.28    |
      +-----------+
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.