[MDEV-5631] Implement Reverse Key Index Created: 2014-02-08  Updated: 2014-04-03  Due: 2014-03-10  Resolved: 2014-02-12

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

Type: Task Priority: Major
Reporter: BELUGABEHR Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-6017 Add support for Indexes on Expressions In Review

 Description   

First time poster... please bare with me...

I'm looking for a reverse key index. I'm storing URLs. I could create two columns, on store the fields in reverse, but I feel a more elegant solution would be to offer a Reverse Key Index strategy.



 Comments   
Comment by Sergei Golubchik [ 2014-02-10 ]

What do you mean by "reverse key index", could you elaborate on that please?

Comment by BELUGABEHR [ 2014-02-12 ]

I suppose this ticket should be titled to more accurately: better support for postfix indexes.

The issue is well covered here:

http://stackoverflow.com/questions/8456272/mysql-efficient-way-for-postfix-search-like-text-aka-prefix-wildcard

CREATE [UNIQUE|FULLTEXT|SPATIAL|REVERSE] INDEX index_name ON tbl_name (index_col_name,...)

Comment by Antonio Fernandes [ 2014-02-12 ]

A workaround could be using a persistent virtual column with the reversed data and then index it... If your database is not very big (or hammered) the penalty of this solution would not be very dramatic... but each case is different

Comment by Sergei Golubchik [ 2014-02-12 ]

A solution to this problem would be to allow functional indexes, it's like

CREATE INDEX ... (REVERSE(a))

that is, to allow index expressions instead of columns. This is being discussed. But there're no immediate plans to have it implemented in the near future.

As a workaround you can, indeed, create a virtual column using this expression and create an index over it.

Comment by Sergei Golubchik [ 2014-02-12 ]

We won't implement "REVERSE" indexes. We might implement functional indexes though.

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