Project

General

Profile

# Date Author Comment
12619 03/06/2014 10:21 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: locationevent: documented `VACUUM ANALYZE` runtime (20 min)

12615 03/06/2014 07:35 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: location: documented `CREATE INDEX plot_source_id` runtime (5 min)

12614 03/06/2014 07:30 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: location: added plot_source_id index to provide the equivalent of the location.source_id index for outer plots. this will help Postgres choose the right query plans in queries involving outer plots.

12606 03/06/2014 08:57 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _plots_18_list_of_subplots_codes_for_each_plot_for_each_project: added ~type table

12604 03/06/2014 08:31 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _plots_15_pct_cover_of_each_verb_taxon_in_each_plot_in_each_pro: added ~type table

12598 03/06/2014 12:33 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: _plots_10a_aggregate_observation_individual_counts: need to use taxonoccurrence.sourceaccessioncode, not aggregateoccurrence.sourceaccessioncode, because aggregateoccurrence.sourceaccessioncode is not populated

12597 03/06/2014 12:09 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations schema comment: documented how to remove a validations query so its columns can be changed (use public_validations.rm_query_view())

12596 03/06/2014 12:07 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql, inputs/SALVIAS/validations.sql: added _plots_10a_aggregate_observation_individual_counts, for use in debugging diffs in _plots_10_count_of_individuals_per_plot_in_each_proj

12589 03/05/2014 12:13 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: locationevent: documented `UPDATE locationevent SET place_visit_id = place_visit_id` runtime (>~1 h)

12586 03/05/2014 07:23 AM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _plots_10_count_of_individuals_per_plot_in_each_project: fixed to handle subplots properly, using new locationevent.place_visit_id

12585 03/05/2014 01:02 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added place_visit view, analogous to plot but for top-level locationevents. this is needed by the SALVIAS validation queries.

12584 03/05/2014 12:59 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: locationevent: added locationevent_set_place_visit_id() trigger, analogous to location_set_plot_location_id() but for the locationevent nesting hierarchy. this is needed by the SALVIAS validation queries.

12583 03/05/2014 12:32 AM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: location_set_plot_location_id(): removed incorrect comment that this is a pull-forward trigger

12582 03/04/2014 05:56 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: public_validations.query_view_relation_max_prefix_len(): added values__ prefix

12580 03/04/2014 05:48 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations: re-auto-added keys(), values_() functions for all queries

12578 03/04/2014 05:40 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations: re-auto-added keys(), values_() functions for all queries

12573 03/04/2014 04:56 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations: auto-added values_() functions for all queries

12566 03/04/2014 03:49 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations: auto-added keys() functions for all queries

12557 03/04/2014 02:20 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced with DB, which reorders ~type tables

12552 02/28/2014 11:17 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: public_validations: schema comment: also need to re-create keys() functions after running public_validations.rm_all_queries()

12551 02/28/2014 11:13 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: added back keys() matchup functions, which get cascadingly deleted when the queries are re-created to change column names, etc. note that this causes the associated ~type tables to sort before them.

12550 02/28/2014 11:11 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added new ~type tables

12547 02/28/2014 10:03 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: rm_all_queries(schema): documented this function's unexpected behavior when schema = public_validations (it removes in all schemas, not just public_validations). this is because this uses rm_query_view().

12546 02/28/2014 09:49 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: use plot (which includes only outer plots) instead of location, to match the input queries

12545 02/28/2014 08:15 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: rm_query_group(): support removing all validations as well as just those with a particular group prefix (and renamed to rm_output_queries())

12544 02/28/2014 07:57 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: public_validations: schema comment: removed incorrect "" in `SET search_path = "public_validations", pg_catalog;` now that they are no longer auto-added

12542 02/28/2014 07:51 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced with DB, which reorders ~type tables

12537 02/27/2014 07:53 PM Aaron Marcuse-Kubitza

schemas/util.sql: raise_error_notice(): raise a WARNING instead because this is for errors, and rename to raise_error_warning() to match

12536 02/27/2014 07:49 PM Aaron Marcuse-Kubitza

schemas/util.sql: raise_error_notice(): raise a WARNING instead because this is for errors, and rename to raise_error_warning() to match

12528 02/27/2014 07:08 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: added back traits* ~type tables

12527 02/27/2014 07:02 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: plots* validation queries: renamed plot_code columns (with names plotcode, plotCode, SiteCode) to match the input queries (plot_code)

12525 02/27/2014 06:42 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: rm_all_queries(): all-schemas mode: also remove queries that are only present on the input side, so that the input side can also be re-created from the DDL file

12524 02/27/2014 06:36 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: rm_all_queries(): documented that this actually does remove queries in all schemas when schema is NULL, because rm_query_view(public_validations.view) searches all schemas

12523 02/27/2014 04:37 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: top_plot view: renamed to plot, as requested by Brad (wiki.vegpath.org/2014-02-27_conference_call#schema-changes)

12521 02/27/2014 03:51 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: location.top_plot: renamed to plot_location_id, as requested by Brad (wiki.vegpath.org/2014-02-27_conference_call#schema-changes)

12520 02/27/2014 02:20 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: source_by_shortname(): documented exact time that the slow query ran for (5013s = ~1.5 hours)

12519 02/27/2014 02:07 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations: schema comment: documented how to sync the queries with schemas/vegbien.sql

12518 02/27/2014 02:05 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations.rm_all_queries(): when called with no args, operate on public_validations instead of all schemas, since this is the more common use case (replacing just the output queries, not both input and output)

12517 02/27/2014 01:49 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: rm_query_group(): documented that this only removes validations output queries (in public_validations), as it is designed for use in updating all output queries at once from the testing DB

12516 02/27/2014 01:27 PM Aaron Marcuse-Kubitza

bugfix: *.sql: public.source_by_shortname(): need to wrap it in a nested SELECT because Postgres incorrectly does not constant-fold (inline) it, leading to a slowdown when it is therefore run many times. this is done using the steps at wiki.vegpath.org/Postgres_queries#wrap-function-call-in-nested-SELECT .

12515 02/27/2014 12:43 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: source_by_shortname(): documented that it must be run as a nested SELECT, because otherwise Postgres will not inline it. not inlining causes the query to be run for each row in a table of potentially millions, and creates a significant slowdown (eg. >1.5 hours for SALVIAS._plots_06_list_of_plots_with_stem_measurements)

12513 02/27/2014 06:51 AM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: source_by_shortname(): needs to be declared STABLE so it can be constant-folded and only run once per query. (it had previously been VOLATILE because of constraints imposed on functions that run `SET LOCAL search_path`.)

12511 02/27/2014 01:11 AM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: location: added index on top_plot

12510 02/27/2014 01:06 AM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _plots_06_list_of_plots_with_stem_measurements: changed columns to match input query

12509 02/27/2014 01:04 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added more ~type tables for plots queries

12507 02/26/2014 11:44 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added public_validations.rm_all_queries(schema), which removes all validations queries in a schema, or in all schemas (useful when recreating validations queries from the DDL export file)

12506 02/26/2014 11:29 PM Aaron Marcuse-Kubitza

schemas/util.sql: validation_views(): moved filtering out of _validations schemas to validatable_datasources() so that calling this function with no args gives the validation views in *all schemas as one would expect

12505 02/26/2014 10:58 PM Aaron Marcuse-Kubitza

schemas/util.sql: query_relations(): support passing in an input query instead of an output query, which will remove only in the datasource's schema. (note that it was not clear that passing in an input-side query was not previously supported.)

12503 02/26/2014 10:30 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: schema_anchor: clarified that this identifies this function's schema (for use in locating helper functions), but is not necessarily the schema operated on, as the comment implied

12500 02/26/2014 01:16 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _plots_04_count_of_plots_in_each_project_in_this_source: count top-level plots to match the input query

12499 02/26/2014 12:29 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_table(): instructions for how to regenerate the diff table: put these at the beginning of the table comment instead of the end, because they are the most important info about the table that a user needs to know

12497 02/26/2014 11:37 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: replaced custom %== operators with much simpler custom keys() functions. this avoids both the need to write out an = comparison for each field, and especially, also the need to write both an operator and a function implementing that operator.

12492 02/25/2014 11:36 PM Aaron Marcuse-Kubitza

schemas/util.sql, vegbien.sql: comment about "function option search_path": don't include `mk_set_search_path()` since that is no longer used

12490 02/25/2014 11:28 PM Aaron Marcuse-Kubitza

schemas/util.sql: use_own_schema(): renamed to use_schema() because this can be used for any type-linked schema

12489 02/25/2014 11:23 PM Aaron Marcuse-Kubitza

bugfix: rematerialize_out_view(): set_search_path() does not take the same arguments as mk_set_search_path() did, so need to use mk_search_path() instead

12484 02/25/2014 10:48 PM Aaron Marcuse-Kubitza

schemas/util.sql, vegbien.sql: use util.use_own_schema()/util.set_search_path() instead of EXECUTE util.mk_use_own_schema()/util.mk_set_search_path()

12441 02/25/2014 11:37 AM Aaron Marcuse-Kubitza

schemas/util.sql, vegbien.sql: do not declare IMMUTABLE SQL-language functions as STRICT, because this prevents them from being inlined (as documented in the util schema comment)

12435 02/25/2014 10:29 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced from DB, which changes the order of the ~type tables

12425 02/25/2014 07:52 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _plots_04_count_of_plots_in_each_project_in_this_source: added operator %== to match the rows by project_name

12424 02/25/2014 07:42 AM Aaron Marcuse-Kubitza

bugfix: schemas/util.sql: diff(text, text) and types that use its custom FULL JOIN matching: need to use separate operator %== for determining which records to put on the same row, so that the = filter for identical rows only excludes rows that are actually the same, not all rows with the same keys (which would usually remove all rows)

12422 02/25/2014 07:14 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced from DB, which changes the order of the ~type tables

12421 02/25/2014 12:24 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _plots_02_list_of_project_names: added = operator that causes FULL JOIN to only use some columns, so that rows for the same label column are put on the same row in the diff table

12418 02/24/2014 11:17 PM Aaron Marcuse-Kubitza

fix: inputs/SALVIAS/validations.sql: _plots_02_list_of_project_names: altered column aliases to match output query

12416 02/24/2014 05:16 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: rm_query_group(): schemas/vegbien.sql: util.drop_relations_like(): also need to drop ~type tables, so that they will be re-created for the new queries of that group

12415 02/24/2014 04:52 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rm_query_group(), which removes all validations queries with a particular group prefix

12414 02/24/2014 04:50 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: generated ~type for _plots_04_count_of_plots_in_each_project_in_this_source

12412 02/24/2014 03:26 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: public_validations._plots_* that use projectname: re-alias to project_name to match input queries. (reexporting apparently changes the relative order of the ~type tables.)

12411 02/24/2014 02:34 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _plots_03_count_of_all_plots_in_this_source: use top_plot instead of location because the corresponding input query includes just the top-level plots

12410 02/24/2014 02:33 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added ~type tables for plots queries that are able to be run successfully

12399 02/24/2014 12:24 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: synced to DB, which changes the sort order (due to system update?)

12390 02/23/2014 07:44 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: public_validations.rename_query_view(): fixed usage

12389 02/23/2014 07:43 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added remake_diff_tables() with no args, which remakes all validatable datasources

12388 02/23/2014 07:40 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validatable_datasources()

12387 02/23/2014 07:36 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validatable_datasources()

12386 02/23/2014 07:31 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: validation_views(): allow leaving out schema to match all datasources

12385 02/23/2014 07:23 PM Aaron Marcuse-Kubitza

schemas/util.sql: show_views_like(): take a schema regexp like util.show_relations_like(), to allow matching views in all schemas

12383 02/23/2014 07:01 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations.remake_diff_table(): put the type table in the public_validations schema to avoid cluttering up the datasource schema with internal tables

12379 02/23/2014 05:32 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: public_validations.remake_diff_table(in_view regclass): document how to regenerate the diff table, in a place that's readily available to someone using the table

12367 02/23/2014 12:13 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _traits_08_taxonname_trait_and_value_for_first_5000_records: renamed to _traits_08_taxonname_trait_and_value because this actually includes all the records, not just the first 5000. this uses the new public_validations.rename_query_view() to rename all associated tables and views, including handling truncated names.

12366 02/23/2014 12:08 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: query_relations(), new_query_view_relation_name(): need to take into account the prefix when determining truncation, using the max_prefix_len param

12365 02/23/2014 12:04 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added query_view_relation_max_prefix_len()

12352 02/22/2014 07:18 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rename_query_view(), which renames all DB objects related to a particular validations query

12351 02/22/2014 07:13 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added new_query_view_relation_name()

12338 02/22/2014 04:04 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added rm_query_view(), which removes all DB objects related to a particular validations query

12337 02/22/2014 03:49 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: remake_diff_tables(): need to set function option search_path in order to limit the effects of `SET LOCAL search_path` (mk_set_search_path()) to the current function

12336 02/22/2014 03:48 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: query_views(): renamed to query_relations() because this also returns non-views

12335 02/22/2014 03:35 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added public_validations.query_views()

12326 02/22/2014 02:03 PM Aaron Marcuse-Kubitza

schemas/util.sql: show_views_like(): reversed argument order to match show_relations_like()

12323 02/21/2014 10:19 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_tables(): updated runtime now that row limit has been removed (same, 45 min)

12322 02/20/2014 07:18 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: _traits_07_trait_value_and_units, _traits_08_taxonname_trait_and_value_for_first_5000_records: removed LIMIT to match the input queries

12319 02/20/2014 06:49 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_tables(): updated bien2_traits runtime (45 min) to include the now-properly-renamed views 6-8

12318 02/20/2014 06:14 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: remake_diff_tables(): documented runtime for bien2_traits (30 min)

12317 02/20/2014 05:52 PM Aaron Marcuse-Kubitza

fix: schemas/vegbien.sql: renamed output views to match input views

12316 02/20/2014 04:52 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: _traits_01_count_records (output side): documented runtime (4 min)

12315 02/20/2014 04:33 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): resolved ambiguous column references by renaming PL/pgSQL vars and adding table qualifiers

12314 02/20/2014 04:28 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): changed from STABLE to VOLATILE because the search_path can only be set in VOLATILE functions

12313 02/20/2014 04:19 PM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: source_by_shortname(): can't be declared STRICT because it now has a 2nd param (schema_anchor) which is always NULL

12312 02/20/2014 08:42 AM Aaron Marcuse-Kubitza

bugfix: schemas/vegbien.sql: remake_diff_tables(): can't raise exception at end if had errors, because this would roll back the transaction. instead use new util.raise_error_notice().

12309 02/18/2014 07:16 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added remake_diff_tables()

12307 02/17/2014 09:06 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: added validation_views()