[MDEV-5494] Queries optimizer : dates queries with LIKE Created: 2013-12-30  Updated: 2015-11-17

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Sunjohn Assignee: Unassigned
Resolution: Unresolved Votes: 5
Labels: None


 Description   

When I was a young and foolish developer, I used to write queries containing things like this :

SELECT * FROM table WHERE `mydate` LIKE '2013-02-%'

which is of course WAAAAAAY slower than

SELECT * FROM table WHERE `mydate` BETWEEN '2013-02-01' AND '2013-03-01'

I'm probably not the only one who ever used a LIKE on a date field for querying subsets based on years, months, days, hours...

It might be interesting to optimize these queries as it should be pretty simple and lead to big performance gains for those who don't really understand what's happening under the hood when the queries they write are executed.



 Comments   
Comment by Elena Stepanova [ 2014-01-08 ]

Hi,

Would you consider implementing the optimization and contributing it as a patch to MariaDB?

Thanks

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