Upgrade von v3.3 auf v3.6

Vorbereitung durch manuelles Erstellen von Datenbankindizes

Mit diesem Update werden eine Reihe von neuen Datenbankindizes eingeführt, um die Performance bei Nutzung des Frontends langfristig zu verbessern. Das Erstellen dieser Indizes kann – abhängig von der Anzahl der verbundenen Sensoren – einige Zeit in Anspruch nehmen.

Um die Downtime während des Updates zu verkürzen, besteht die Möglichkeit, die Indizes bereits im Vorfeld manuell zu erstellen. Dieser Schritt ist optional.

Wenn die Indizes nicht manuell angelegt werden, werden sie automatisch im Rahmen des Updates erstellt.

Hinweis

Das manuelle Erstellen der Indizes erfordert SQL- und Datenbankkenntnisse. Führe diesen Schritt nur aus, wenn du damit vertraut bist.

Ablauf

  1. Aktualisiere die PureLife-Cloud auf v3.3.
  2. Führe die folgenden SQL-Statements zur Laufzeit der PureLife-Cloud v3.3 aus.
  3. Überprüfe, ob die Indizes erfolgreich angelegt wurden.
  4. Aktualisiere die PureLife-Cloud auf v3.6.
prepare_update_3.6.sql
 1CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_sensor_id_create_date_type ON sensor_event USING btree (sensor_id, create_date DESC, "type");
 2CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_content_gin ON sensor_event USING GIN ("content");
 3CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_extracted_content_gin ON sensor_event USING GIN (extracted_content) WHERE extracted_content <> '{}'::jsonb;
 4CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_sensor_id_type ON sensor_event USING btree (sensor_id, "type");
 5CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_heatmap_fall ON sensor_event (sensor_id, create_date) WHERE "type" = 'fall';
 6CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_calendar_fall ON sensor_event (sensor_id, create_date) WHERE "type" = 'fall' AND "action" = 'calling';
 7CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_register ON sensor_event (sensor_id, create_date DESC) WHERE "type" = 'register';
 8CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_walking_time ON sensor_event (sensor_id, create_date) WHERE
 9  "type" = 'status' AND jsonb_path_match("content", '$."walkingTimeSeconds" > 0');
10CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_heatmap_presence_vayyar ON sensor_event (sensor_id, create_date) WHERE
11  "type" = 'presence' AND "action" = 'presence' AND
12  jsonb_path_match("content", '$.payload.trackerTargets.size() > 0');
13CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_heatmap_presence ON sensor_event (sensor_id, create_date) WHERE
14  "type" = 'presence' AND "action" = 'presence' AND
15  jsonb_path_match("extracted_content", '$.targets.size() > 0');
16CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_sensor_event_unknown_search ON sensor_event (create_date) WHERE "type" = 'unknown';
17DROP INDEX CONCURRENTLY IF EXISTS idx_sensor_event_type_and_action;
18DROP INDEX CONCURRENTLY IF EXISTS idx_sensor_event_type;
19DROP INDEX CONCURRENTLY IF EXISTS idx_sensor_event_action;

Debian

  1. Folge der allgemeinen Anleitung.

Docker

Wenn du die Konfigurationsdateien deiner Docker-Installation angepasst hast, kannst du dir bei GitHub anschauen, wie sich die Konfiguration verändert hat.

  1. Folge der allgemeinen Anleitung.