The stored procedure GENERATE_SMART_STATS_FOR_FIELDS gathers and
stores the statistics of the fields of a JDBC base view (minimum value,
maximum value, etc. of each field) and the number of rows of the view.

To obtain these statistics, it queries the system tables of the
database, instead of executing a SELECT query with several
aggregation functions as the procedures GENERATE_STATS and
GENERATE_STATS_FOR_FIELDS do. The benefit of this approach is that
obtaining the statistics of the view is much faster.

This procedure can only be used to gather the statistics of JDBC base
views. To gather the statistics of other types of views, use
GENERATE_STATS (see GENERATE_STATS) or
GENERATE_STATS_FOR_FIELDS (see GENERATE_STATS_FOR_FIELDS).

Before obtaining the statistics for a JDBC base view, make sure that the
source database (Oracle, IBM DB2, etc.) has the statistics of this
table. If the statistics are not present or are outdated, the statistics
gathered will not be accurate and the execution plans selected by the
cost-based optimizer could be suboptimal.

SMART_ONLY: the procedure gathers the statistics from the system
tables of the database.

This mode is equivalent to clearing the check box “Complete missing
statistics…” in the “Statistics” tab of the view’s “Options”.

SMART_THEN_ATSOURCE_THROUGH_VDP: the procedure gathers the
statistics from the system tables of the database. Then, it executes
a SELECT statement to gather the statistics that it cannot not
obtain from the system tables of the database.

This mode is equivalent to selecting the check box “Complete missing
statistics…” in the “Statistics” tab of the view’s “Options”.

ATSOURCE_THROUGH_VDP_ONLY: the procedure does not query the
system tables. Instead, it just execute a SELECT statement. This
mode is equivalent to executing the procedures GENERATE_STATS or
GENERATE_STATS_FOR_FIELDS. This option is not available from the
administration tool.

view_name: the procedure will gather the statistics of this view
(with the same case).

fields: array of registers with the fields whose statistics you want
to gather. Each register has these fields: