(re)consider your database layout
Per discussion at our last meeting, the Pyre database creates a new table per thread. Each table contains the exact same set of columns, the only thing different is which thread they're in. I suggest moving to them all to one table, with the same columns plus one more for the thread id