From ccdf8de59ec312e23b4b83f22e129b5f4137d6e3 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Tue, 12 Jan 2016 12:08:41 +0100 Subject: [PATCH] Enhance documentation, update comments --- doc/CDB_Overviews.md | 10 +++++++--- scripts-available/CDB_Overviews.sql | 8 ++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/CDB_Overviews.md b/doc/CDB_Overviews.md index b463228..019a856 100644 --- a/doc/CDB_Overviews.md +++ b/doc/CDB_Overviews.md @@ -7,6 +7,8 @@ The *reduction* consists in a fewer number of records and/or simplified record geometries. 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 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) * **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 should have these arguments: - **table_name** regclass, table to compute the reference Z scale for -* **reduction_strategy** regproc, function that provides the reduction strategy - to generate an overview table from a table for a smaller scale (higher Z number). +* **reduction_strategy** regproc, optional function that provides + 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 should have these arguments: - **base_table_name** regclass, base table to be reduced. diff --git a/scripts-available/CDB_Overviews.sql b/scripts-available/CDB_Overviews.sql index 987f6c5..83e29ea 100644 --- a/scripts-available/CDB_Overviews.sql +++ b/scripts-available/CDB_Overviews.sql @@ -257,9 +257,8 @@ AS $$ PERFORM _CDB_Add_Indexes(overview_table); - -- TODO: we'll need to store metadata somewhere to define - -- which overlay levels are available. Here we should add this metadata - -- (or replace existing metadata) + -- TODO: If metadata about existing overviews is to be stored + -- it should be done here (CDB_Overviews would consume such metadata) END $$ LANGUAGE PLPGSQL; @@ -417,7 +416,6 @@ AS $$ SELECT string_agg(s.column, ',') FROM ( SELECT * FROM cols ) AS s INTO columns; - RAISE NOTICE 'COLUMNS: %s', columns; EXECUTE Format('DROP TABLE IF EXISTS %s CASCADE;', overview_rel); @@ -474,8 +472,6 @@ DECLARE overview_tables REGCLASS[]; overviews_step integer := 1; BEGIN - -- TODO: adjust statement_timeout here based on input table size? - -- Determine the referece zoom level EXECUTE 'SELECT ' || quote_ident(refscale_strategy::text) || Format('(''%s'');', reloid) INTO ref_z;