Training: topic 7 (PostgreSQL and PostGIS) and a topic 0 for workstation setup

Topic 7 follows section 6.7 of the Training Plan: six exercises over about
eleven hours, with answers and seven figures. Reading a schema you did not
design; SQL that answers a planning question; geometry and the ST_ functions;
indexes and query plans; backup, restore and a safe migration; then the
hands-on — parcels per zone for Sagnarigu Municipal, answered two ways.

Unlike the earlier topics this one had a real database to work against, so
every query, plan and timing in the answers was measured rather than described.
Parcels per zone takes 14 779 ms as the data is stored, 140 ms once the zone
geometry is a geometry column with a GiST index, and 53 ms with the parcels
indexed too — the same answer all three times, and almost all of the gain from
the type rather than the indexes. A district count on the live table is a
sequential scan over 211 264 buffers in 2.6 seconds; indexed, it is 60 buffers
and 16 ms.

The hands-on ends somewhere more useful than a number. The attribute answer
places all 67 560 parcels in a zone; the spatial answer places 27 880, because
the collector-zone polygons cover 64 km² of a 440 km² district. Where both
speak they agree 99.4 % of the time, so the likeliest reading is incomplete
zone polygons rather than wrong attributes — which is a reading, not a result,
and the exercise says so and sends it to the trainer.

Topic 0 is new and is not a teaching day: the half day before topic 1, covering
what has to be installed and proving it afterwards. Windows step by step with
the installer choices that matter, macOS in a dozen Homebrew commands, cloning
LUPMIS2 and getting npm run dev to a map, restoring the training database, a
nine-command readiness check, and the five failures that account for nearly
every lost morning. Written for machines where the trainee has administrator
rights, with every tool installed in one pass.

Still open in topic 7: exercise 6 part D compares the SQL with the application's
own zonal statistics, and only the SQL side is measured — the LUPMIS API was
unreachable. To be redone when the server is back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
ekke 2026-10-01 17:30:25 +02:00
parent 7ce20bd498
commit 7a6bf9b022
2 changed files with 0 additions and 0 deletions

Binary file not shown.

Binary file not shown.