GET_AVAILABLE_STATS_MODES

Description

The stored procedure GET_AVAILABLE_STATS_MODES returns the modes that are available to call the stored procedure GET_STATS_FOR_FIELDS for a given view.

Syntax

GET_AVAILABLE_STATS_MODES (
      input_database_name : text
        , input_view_name : text
    , input_empty_on_failure: boolean
)
  • input_database_name: name of the database to which view_name belongs.

  • input_view_name: the name of the view.

  • input_table_stats: if true, the procedure will return an empty result if any error occurs. If false, the procdure execution will fail.

This procedure returns one row for each mode with these fields:

  • database_name: name of the database.

  • view_name: the name of the view.

  • view_type: type of the view.

  • stats_mode: the name of gathering statistics mode.

  • available: true when statistics of the view can be gathered using this mode. false otherwise.

  • description: Reason why this mode cannot be used to gather the statistics of the view.

  • description_code: code for the description.

  • available_smart_stats: Array with a list of statistics that can be obtained from system tables when using this mode.

  • is_smart: true when statistics are gathered from system tables. false otherwise.

  • is_aggregate: true when statistics are gathered using SELECT queries with aggregation functions. false otherwise.

  • is_cache: true when statistics are gathered from the database where the view is cached. false otherwise.

Examples

CALL GET_AVAILABLE_STATS_MODES('admin'
    , 'internet_inc'
    , false);