Bug #4990 Functional Indexes
Submitted: 11 Aug 2004 14:14 Modified: 23 Jun 2015 14:05
Reporter: Federico Razzoli (OCA) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[11 Aug 2004 14:14] Federico Razzoli
Description:
I hope you will implement functional indexes, like PostgreSql. For example:

CREATE INDEX myindex ON mytable (MONTH(date))

or

CREATE INDEX myindex ON mytable (LEFT(REVERSE(textfield), 5))

or even:

CREATE INDEX myindex ON mytable ( CONCAT(IF(name IS NOT NULL, name, ''), ' ', surname) )

I think it would speed up seriously some searches...

How to repeat:
n/a

Suggested fix:
n/a
[2 Sep 2007 18:50] Valeriy Kravchuk
Thank you for a reasonable feature request.
[5 Oct 2008 11:58] Konstantin Osipov
Bug#24772 Function Based Indexes was marked a duplicate of this bug.
[10 Oct 2008 11:48] Alexander Barkov
Bug#17496 Function-based keys - was marked a duplicate for this report.
[25 Nov 2008 12:08] [ name withheld ]
Should be marked as duplicate of http://bugs.mysql.com/bug.php?id=14818
[25 Nov 2008 13:17] Valeriy Kravchuk
Bug #14818 was marked as a duplicate of this one.
[24 Aug 2009 8:12] Mattias Jonsson
Closed bug#36794 as a duplicate of this.

Also there is a community preview of Virtual Columns and functional indexes:
http://forge.mysql.com/wiki/MySQL_virtual_columns_preview
[1 Nov 2012 15:14] Bogdan Gusiev
Any progress on this?
[4 May 2015 18:59] Morgan Tocker
WL #411 was implemented in MySQL 5.7 (Generated columns).  The syntax is a little different from a purely functional index, but it should be feature equivalent.
[23 Jun 2015 14:04] Morgan Tocker
Posted by developer:
 
I am closing this bug now, as generated columns (WL#411) provides a suitable alternative to functional indexes.

If you believe this to be in error, please feel free to re-open this feature request.  We would value any input that demonstrates a clear use case where generated columns are not suitable, but functional indexes are. Thanks!