Setup database statistics

Informix® provides a special instruction to compute database statistics in order to help the optimizer find the right query execution plan:

UPDATE STATISTICS ...

Sybase ASE offers a similar instruction, but it uses different clauses:

UPDATE STATISTICS ...

See Sybase ASE documentation for more details.

Solution

Centralize the optimization instruction in a function.