4 ms·
I wonder if defining a virtual table (https://www.sqlite.org/vtab.html https://www.sqlite.org/vtab.html) and just doing INSERT INTO t (...) SELECT ... from vir
by lmz 5y ago
I wonder if defining a virtual table (https://www.sqlite.org/vtab.html https://www.sqlite.org/vtab.html) and just doing
INSERT INTO t (...) SELECT ... from virtual_table
would be any faster.
- rubyfan 5y agoFrom my armchair here I thought something similar, I think I heard 1) that inserting into the same table has some speed limitations and 2) one of the authors ideas was to spin up 4 processes… I wonder if you could insert into 10 different tables from 10 threads or processes then insert into single_table (…) select (…) union. No idea if insert select does the trick or not but you’re almost at the point of partitioning here. If the application called for it you could do some sort of poor mans partition in order to write all the data and then push some complexity into the read. I also wondered what if any impact the ID primary key had on inserting at the level of frequency. /armchair
- roberto 5y agoIf you define the virtual table would you even need to do the `INSERT`? Just query the virtual table instead of inserting into `t` and querying `t`.