DB2 LUW Generated Columns and Expression-Based Indexes
Prior to DB2 10.5, Expressed-based indexes were not available on DB2 LUW. But generated-columns have been around for a long time. With DB2 below version 10.5 you would need to create a generated-column and then an index on that column so the DB2 optimizer would use it. I’ve gotten huge performance improvements with generated-columns in the past, I mean order of magnitude type improvements. Well with 10.5 and above DB2 supports Expression-based indexes where you define the expression in the CREATE INDEX clause. So, going forward you will probably want to use the Expressed-based index feature instead of generated-columns. For the full benefits take a look at the DB2 Information Center: https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.dbobj.doc/doc/c0061101.html