I'm going to add a Datasette setting to disable threading entirely, designed for usage in this particular case.
I thought about adding a new setting, then I noticed this:
datasette mydatabase.db --setting num_sql_threads 10
I'm going to let users set that to 0 to disable threaded execution of SQL queries.
Originally posted by @simonw in #1733 (comment)