From 35877d6390c41a2b1a3d5c8c477409e2001fc0ab Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 24 Aug 2022 13:27:05 +0300 Subject: [PATCH] databaseReset docum update --- handbook/troggle/trogimport.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/handbook/troggle/trogimport.html b/handbook/troggle/trogimport.html index 24d53027e..5c7deb794 100644 --- a/handbook/troggle/trogimport.html +++ b/handbook/troggle/trogimport.html @@ -12,7 +12,7 @@

Troggle - Reset and import data

-The python stand-alone script databaseRest.py imports data from files into the troggle database (sqlite or MariaDB). It is separate from the process which runs troggle and serves the data as webpages (via apache), but it is plugged in to the same hierarchy of django python files. +The python stand-alone script databaseReset.py imports data from files into the troggle database (sqlite or MariaDB). It is separate from the process which runs troggle and serves the data as webpages (via apache), but it is plugged in to the same hierarchy of django python files.

In the :troggle: directory:

$ python databaseReset.py
 
@@ -23,7 +23,7 @@ Usage is 'python databaseReset.py  [runlabel]'
                         -  del       - deletes last entry
                         -  delfirst  - deletes first entry
 
-             reset     - normal usage: clear database and reread everything from files - time-consuming
+             reset     - normal usage: clear database and reread everything from files.
 
              init      - initialisation. Automatic if you run reset.
              caves     - read in the caves (must run first after initialisation)
@@ -42,8 +42,15 @@ Usage is 'python databaseReset.py  [runlabel]'
              caves and logbooks must be run on an empty db before the others as they
              set up db tables used by the others.
 
+

On the main server you should only ever run the full reset option. The different stages are not cleanly separated now and apparently never have been. +Later quick fixes to accomodate last-minute requests for wallets and survex files have further intertwined the precedence relationships. +

On a clean computer using sqlite a complete import takes 100 seconds now if nothing else is running (200s if running on an SD card not a SSD). -On the shared expo server it takes 600s as it is a shared machine. More than half of the time on the server is reinitialising the MariaDB database. +On the shared expo server it takes 600s. More than half of the time on the server is reinitialising the MariaDB database which is much, much slower than +sqlite on a development machine. + +

These options exist so that when doing software development on your own troggle laptop, +you can speed up debugging (e.g. survex stuff) by skipping the logbooks data entry.

Here is an example of the output after it runs, showing which options were used recently and how long each option took (in seconds).