I recall you need the mbs database plugins to have an async insert.
xojo doesn’t support it.
may be @Christian_Schmitz can confirm.
also
instead of making 800M calls to sqlexecute, you can make 1000 lines of text with inserts
it will take almost as mush time as one line call
it will reduce the global time by 1000x
If this is a one time job,
you could also construct a file containing all INSERT statements and then use a Database tool such as MySQLWorkbench to insert all rows.
Send your data to a helper app, fast, maybe writing to a SQLite intermediary DB, in blocks to avoid hiccups, 1 to 100 records each block, and your helper will work in background reading your local source and inserting them into the MySQL.
Because “threads” in xojo are a scam, they arent “real” (preemptive) threads that can run in parallel, they are “Cooperative” threads that run in the same thread as the GUI, sharing time slices of a single phisical core (Yes, just one). A worker is a separate app than can run in parallel using a different core.
The fake cooperative threads are not implemented in the best way. When you Run the thread, the app inmediatly switches to execute that thread, leaving the Main one (App GUI) frozen until the app decides to asign some time slice to the GUI again.
Maybe this is what is happening in your app, try using a CallLater to run the thread. This way, the main thread will finish the current sub avoiding the unresponsive app.
Wow, just look at your CPU usage, most probably, a single very bussy core while the rest of them are idle.
Because Xojo does not have threads but fibers named as threads. There’s only one real thread in a Xojo app, and when some part of the app is busy, other part is suspended. No parallelism, just time slicing. A helper allows parallelism, it takes a separate real thread and maybe even in another CPU core.
You may better go and do 1000 at a time to keep things responsible.
You may run them on a Xojo thread, a worker, a console app to be able to show a progress bar while doing it. MBS Xojo SQL Plugin can run statements on background thread (preemptive thread).
Workers are a separate console app which can run on an entirely separate core whereas Xojo threads are part of the same app, run on the same core and take time away from the rest of the app.
in the worker you can define the number of cores to use, what happens if I indicate (8) more than the CPU (that has 4 core ) on which the application is running