FHCA-2461 IDEMP - ad_column table - Framework query improvement

Description

One DBA from FH suggested to improve this very frequent query:

SELECT AD_Table_ID, AccessLevel, TableName, IsView, (SELECT ColumnName FROM AD_COLUMN WHERE AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID AND AD_COLUMN.COLUMNNAME = AD_TABLE.TABLENAME || '_ID') FROM AD_Table WHERE IsActive='Y'

Adding UPPER to use the index, like this:

SELECT AD_Table_ID, AccessLevel, TableName, IsView, (SELECT ColumnName FROM AD_COLUMN WHERE AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID AND upper(AD_COLUMN.COLUMNNAME) = upper(AD_TABLE.TABLENAME || '_ID')) FROM AD_Table WHERE IsActive='Y';

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created March 12, 2021 at 3:58 PM
Updated September 5, 2022 at 5:18 PM
Resolved March 16, 2021 at 9:07 AM

Flag notifications