Enable view folding to improve query performance
You can significantly improve the performance of a query that involves a view by enabling view folding.
You do this by setting the IFX_FOLDVIEW configuration parameter
to 1
.
When view folding is enabled, views are folded into a parent query. Because the views are folded into the parent query, the query results are not placed in a temporary table.
You can use view folding in the following types of queries:
- Views that contain a UNION ALL clause and the parent query incldues a regular join, Informix® join, ANSI join, or an ORDER BY clause
View folding does not occur for the following types of queries that perform a UNION ALL operation involving a view:
- The view has one of the following clauses: AGGREGATE, GROUP BY, ORDER BY, UNION, DISTINCT, or OUTER JOIN (either Informix® or ANSI type).
- The parent query has a UNION or UNION ALL clause.