PostgreSQL Maestro online Help
| Prev | Return to chapter overview | Next |
Setting index expressions
Expression
An index field can be an expression computed from the values of one or more columns of the table row. This feature can be used to obtain fast access to data based on some transformation of the basic data. For example, an index computed on upper(col) would allow the clause WHERE upper(col) = 'JIM' to use an index. To set the index expression, use the Add expression button and enter the expression in the corresponding window.
Example
Suppose, there is a table Employee with the salary and premium fields and queries as follows are executed very often.
SELECT *
FROM "Employee"
WHERE "salary"+"premium">5000;
To create an index making such queries faster, set salary+premium as the index expression.

| Prev | Return to chapter overview | Next |






