Hi All,
I have a requirement of creating a view which is having joins on 9 tables. This view is used by Cognos team to fetch data for reporting.
For reporting purpose, they need mostly counts based on some where clauses.For one of those where clauses the query on view is taking too long. This where clause contains a derived column. Even if I create index on the base column, the query dosen't speeds up.
The query which they are firing on view is:
select count(*) from test_view where col2='Approved';
This col2 is derived as follows:
Coalesce((CASE col1 When 'Y' Then 'Approved' When 'N' Then 'Rejected' Else NULL End),'Pending') col2
Please guide as to how can i increase the query efficiency.
Thanks in adv