Loom has slow performance in `_store_kind_partition` after estimating CrossCat model
versar opened this issue · 2 comments
versar commented
After estimating the CrossCat partition, the implementation of loom in bayeslite stores the CrossCat views, and for each view the row partitions, into a BQL table. This is implemented in a nested loop (over models, over views, and over rows) leading to a high number of SQL insertions.
bayeslite/src/metamodels/loom_metamodel.py
Lines 436 to 444 in fdf7f2f
Some possibilities for addressing this issue include:
- constructing a Pandas dataframe and using df.to_sql to store the dataframe into the .bdb object
- construct a big string for one bulk SQL INSERT
- add query types that exist in bayeslite but not Loom to the Loom query server
fsaad commented
Also consider wrapping inserts in a transaction.