# Expression Index

+ An expression index is a special kind of index that allows you to build an index on an expression: `CREATE INDEX idx1 ON t1 ((lower(col1)));` 
+ You can find out which function can be used for expression indexing by querying system variables: `tidb_allow_function_for_expression_index`  
```
mysql> select @@tidb_allow_function_for_expression_index;
+--------------------------------------------------------------+
| @@tidb_allow_function_for_expression_index                   |
+--------------------------------------------------------------+
| lower, md5, reverse, upper, vitess_hash                      |
+--------------------------------------------------------------+
```
------------------------------------------------------------
Expression index
- An expression index is a special index that allows you to build an index on an expression.
- In some scenario, the condition of the query is often filtered based on an expression.
- Expressions in the expression index need to be enclosed by (and), otherwise a syntax error will be reported.
```
CREATE INDEX idx1 ON t1 ((lower(col1)));
```
- Only some function are allowed to create expression indexes, which can be obtained by querying the variable tidb_allow_function_for_expression_index
```
mysql> select @@tidb_allow_function_for_expression_index;
+--------------------------------------------+
| @@tidb_allow_function_for_expression_index |
+--------------------------------------------+
| lower, md5, reverse, upper, vitess_hash    |
+--------------------------------------------+
```
