News for hackers. Stuff that matters.
Re:Batch size one billion: SQLite insert speedups, from the ... by hot_gril on Tuesday September 26, 2023 @01:23PM (#37662704)
That's what I expect, but for these very simple batch insert queries, it's hard to guess which takes longer.
Re:Batch size one billion: SQLite insert speedups, from the ... by _a_a_a_ on Tuesday September 26, 2023 @01:36PM (#37662887)
A very simple statement may not be as simple as it looks to execute.

The table here is unconstrained (from the article "CREATE TABLE integers (value INTEGER);") but suppose that table had a primary key and a foreign key – a simple insertion of a single value into such a table would look trivial but consider what the query plan would look like as it verifies the PK and FK aren't violated. And maybe there are a couple of indexes to be updated as well. And a check constraint or three. Suddenly a simple INSERT of a literal value becomes quite involved under the skin.

Re:Batch size one billion: SQLite insert speedups, from the ... by hot_gril on Tuesday September 26, 2023 @04:36PM (#37665487)
Right, but in this particular example, the table is just

  CREATE TABLE integers (value INTEGER);
Re:Batch size one billion: SQLite insert speedups, from the ... by _a_a_a_ on Tuesday September 26, 2023 @04:52PM (#37665657)
I said exactly that.
Re:Batch size one billion: SQLite insert speedups, from the ... by hot_gril on Tuesday September 26, 2023 @05:08PM (#37665836)
My bad, missed the first part.
Re:Batch size one billion: SQLite insert speedups, from the ... by _a_a_a_ on Tuesday September 26, 2023 @05:37PM (#37666121)
Happen, happen, we've all done it. NP