Enhance documentation, update comments

This commit is contained in:
Javier Goizueta 2016-01-12 12:08:41 +01:00
parent a2f6cb4c04
commit ccdf8de59e
2 changed files with 9 additions and 9 deletions

View File

@ -7,6 +7,8 @@ The *reduction* consists in a fewer number of records
and/or simplified record geometries. and/or simplified record geometries.
Overviews are created through the `CDB_CreateOverviews`. Overviews are created through the `CDB_CreateOverviews`.
The statement timeout may need to be adjusted before using this function,
as overview creation for large tables is a time-consuming operation.
The `CDB_Overviews` function can be used determine what overview tables The `CDB_Overviews` function can be used determine what overview tables
exist for a given dataset table and which zoom levels correspond tt exist for a given dataset table and which zoom levels correspond tt
@ -31,12 +33,14 @@ SELECT CDB_CreateOverviews('table_name');
CDB_CreateOverviews(table_name, ref_z_strategy, reduction_strategy) CDB_CreateOverviews(table_name, ref_z_strategy, reduction_strategy)
* **table_name** regclass, table for which overviews will be generated * **table_name** regclass, table for which overviews will be generated
* **ref_z_strategy** regproc, function that provides the Z-scale strategy. * **ref_z_strategy** regproc, optional function that provides
the Z-scale strategy.
It returns the base Z level for the dataset. It returns the base Z level for the dataset.
It should have these arguments: It should have these arguments:
- **table_name** regclass, table to compute the reference Z scale for - **table_name** regclass, table to compute the reference Z scale for
* **reduction_strategy** regproc, function that provides the reduction strategy * **reduction_strategy** regproc, optional function that provides
to generate an overview table from a table for a smaller scale (higher Z number). the reduction strategy to generate an overview table from a table
for a smaller scale (higher Z number).
It returns the name of the generated table. It returns the name of the generated table.
It should have these arguments: It should have these arguments:
- **base_table_name** regclass, base table to be reduced. - **base_table_name** regclass, base table to be reduced.

View File

@ -257,9 +257,8 @@ AS $$
PERFORM _CDB_Add_Indexes(overview_table); PERFORM _CDB_Add_Indexes(overview_table);
-- TODO: we'll need to store metadata somewhere to define -- TODO: If metadata about existing overviews is to be stored
-- which overlay levels are available. Here we should add this metadata -- it should be done here (CDB_Overviews would consume such metadata)
-- (or replace existing metadata)
END END
$$ LANGUAGE PLPGSQL; $$ LANGUAGE PLPGSQL;
@ -417,7 +416,6 @@ AS $$
SELECT string_agg(s.column, ',') FROM ( SELECT string_agg(s.column, ',') FROM (
SELECT * FROM cols SELECT * FROM cols
) AS s INTO columns; ) AS s INTO columns;
RAISE NOTICE 'COLUMNS: %s', columns;
EXECUTE Format('DROP TABLE IF EXISTS %s CASCADE;', overview_rel); EXECUTE Format('DROP TABLE IF EXISTS %s CASCADE;', overview_rel);
@ -474,8 +472,6 @@ DECLARE
overview_tables REGCLASS[]; overview_tables REGCLASS[];
overviews_step integer := 1; overviews_step integer := 1;
BEGIN BEGIN
-- TODO: adjust statement_timeout here based on input table size?
-- Determine the referece zoom level -- Determine the referece zoom level
EXECUTE 'SELECT ' || quote_ident(refscale_strategy::text) || Format('(''%s'');', reloid) INTO ref_z; EXECUTE 'SELECT ' || quote_ident(refscale_strategy::text) || Format('(''%s'');', reloid) INTO ref_z;