Question: This is for InnoDB with MySQL 5.7.

If I have a query like:

```
SELECT A, B, C FROM TABLE WHERE STRCMP(D, 'somestring') > 0

```

Is it possible to have an index on `D` which can be used by the query? i.e. is MySQL smart enough to use the btree index for STRCMP function?

If not, how might I be able to redesign the query (and/or table) such that I can do string comparison on D, and there can be some form of pruning so that it does not have to hit every single row?

Answer: 
Why not just

```
WHERE D > 'somestring'

```

This would leverage a typical B-tree index on column `D`.
Mysql will not use indexes for function calls.

Use below query And Create index on **D** column

```
SELECT A, B, C FROM TABLE WHERE D ='somestring'

```

to create index use the below query

```
 create index index1 on TABLE(D);

```