I know that databases are able to optimally use an index for queries `WHERE x like "foo%"`.  

But in theory, if you will reverse the text and store the reversed string in the index,  

then that index could be used to optimally search `WHERE x like "%foo"`

Is there any way to create such inversed index in MySQL or any other database?