[MDEV-9655] Very slow query with CONVERT and REPLACE Created: 2016-02-28  Updated: 2016-02-28

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: upstream-fixed


 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    |
+-----------+


Generated at Thu Feb 08 07:36:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.