FT_StoreStatisticalData#

Summary#

FT_StoreStatisticalData stores the collected statistical data. It returns the primary key value that corresponds to the identifier of the row inserted into the table Execution.

Signatures#

integer FT_StoreStatisticalData(text index_name, text index_directory, integer statistic_option=1, integer loc_stat_data=1, text file=NULL);

integer FT_StoreStatisticalData(text apath, integer statistic_option=1, integer loc_stat_data=1, text file=NULL);

Description#

FT_StoreStatisticalData stores the collected statistical data. It returns the primary key value that corresponds to the identifier of the row inserted into the table Execution.

This operation has two versions and its parameters are:

  • index_name is the name of the index file.
  • index_directory is the directory path that stores the index file.
  • apath is the absolute path of the index file.
  • statistic_option refers to the type of statistical data to be collected and stored. If statistic_option is equal to 1, its default value, FESTIval collects standard statistical data to be inserted as a new tuple in the table Execution. If statistic_option is equal to 2 or 4, FESTIval collects statistical data related to the structure of the index to be inserted as a new tuple in the table IndexSnapshot. If statistic_option is equal to 3 or 4, FESTIval collects the nodes of the index to be inserted as new tuples in the table PrintIndex. Note that the value 4 indicates, therefore, that all types of statistical data is collected and stored.
  • loc_stat_data defines where the statistical data should be stored. If its value is equal to 1, its default value, the statistical data is stored directly in the FESTIval’s data schema. If its value is equal to 2, the statistical data is stored in a SQL file that can be latter loaded into the FESTIval’s data schema.
  • file is the absolute path of the SQL file that will store the statistical data, if loc_stat_data is equal to 2. This file will be created if it does not exist. This parameter is not used if loc_stat_data is equal to 1.

Note

  • We recommend that you see the FESTIval's data schema in order to understand the types of statistical data that can be managed.
  • If loc_stat_data is equal to 2, the returning value is invalid since the insertion is not made directly on the table Execution. A valid treatment is performed on the file storing the statistical data.

Caution

If loc_stat_data is equal to 2, the connected user of the database must be permission to write in the directory storing this SQL file. Otherwise, an error is returned.

Examples#

--setting the execution name
SELECT FT_SetExecutionName('an insertion followed by an update operation');

--start collecting statistical data
SELECT FT_StartCollectStatistics();

--performing the operations
SELECT FT_Insert('r-tree', '/opt/festival_indices/', 50, 
    ST_GeomFromText('POLYGON((-6349160.26886151 -751965.038197354,-6349160.26886151 -606557.85245731,-6211936.96741955 -606557.85245731,-6211936.96741955 -751965.038197354,-6349160.26886151 -751965.038197354))', 3857)
    );

SELECT FT_Update('/opt/festival_indices/rstartree-brazil_points2017', 50, 
    ST_GeomFromText('POLYGON((-6349160.26886151 -751965.038197354,-6349160.26886151 -606557.85245731,-6211936.96741955 -606557.85245731,-6211936.96741955 -751965.038197354,-6349160.26886151 -751965.038197354))', 3857),
    50, ST_Buffer(ST_GeomFromText('POLYGON((-6349160.26886151 -751965.038197354,-6349160.26886151 -606557.85245731,-6211936.96741955 -606557.85245731,-6211936.96741955 -751965.038197354,-6349160.26886151 -751965.038197354))', 3857), 10)
    );

--storing the collected statistical data
SELECT FT_StoreStatisticalData();

See Also#