databaseReset docum update

This commit is contained in:
Philip Sargent 2022-08-24 13:27:05 +03:00
parent efddedaffd
commit 35877d6390

View File

@ -12,7 +12,7 @@
<h3>Troggle - Reset and import data</h3>
<p>
The python stand-alone script <var>databaseRest.py</var> 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 <var>databaseReset.py</var> 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.
<p>In the :troggle: directory:
<code><pre>$ python databaseReset.py
@ -23,7 +23,7 @@ Usage is 'python databaseReset.py <command> [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 <command> [runlabel]'
caves and logbooks must be run on an empty db before the others as they
set up db tables used by the others.
</pre></code>
<p>On the main server you should <b>only ever run the full <em>reset</em></b> 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.
<p>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.
<p>These options exist so that when doing software development on your own <a href="troglaptop.html">troggle laptop</a>,
you can speed up debugging (e.g. survex stuff) by skipping the logbooks data entry.
<p>Here is an example of the output after it runs, showing which options were used recently and how long
each option took (in seconds). <code><pre>