create index if not exists employee_index
on employee(emp_id, (emp_first_name|| ' ' ||emp_last_name));
I'm able to use the above statement in Postgres, I want to have it in my Liquibase changeset. I need to combine the first and last names as above in the index since it gives better performance. I was told that I can't deviate from it.
You can create an expression based index by enclosing the expression in parentheses:
<createIndex tableName="employee" indexName="employee_index">
<column name="emp_id"/>
<column name="(emp_first_name||' '||emp_last_name)"/>
</createIndex>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.