[sqlite] SQLite slows by a factor of 1000 after foreign key violation

2015-10-02 Thread Dan Kennedy
On 10/01/2015 10:32 PM, Andrew Cunningham wrote: > I have noticed that when FOREIGN KEY is in DEFERRED mode and a FOREIGN KEY > violation occurs, SQLite will continue to run, but performance slows down > by about 1000x. Breaking into the code shows that it seems to be > continually re-reading the d

[sqlite] SQLite slows by a factor of 1000 after foreign key

2015-10-01 Thread Simon Slavin
On 1 Oct 2015, at 6:36pm, Andrew Cunningham wrote: > A FOREIGN KEY violation that occurs in IMMEDIATE mode, though it causes an > error, is often not actually a real error. Sometimes the "VIOLATION" (of > referential integrity) is corrected at a later point ( order of operations > is important)

[sqlite] SQLite slows by a factor of 1000 after foreign key

2015-10-01 Thread Klaas V
Andrew Cunningham wrote: >I have noticed that when FOREIGN KEY is in DEFERRED mode and a FOREIGN KEY >violation occurs, SQLite will continue to run, but performance slows down >by about 1000x. Breaking into the code shows that it seems to be >continually re-reading the database. When I finally ge

[sqlite] SQLite slows by a factor of 1000 after foreign key

2015-10-01 Thread Andrew Cunningham
Hi, A FOREIGN KEY violation that occurs in IMMEDIATE mode, though it causes an error, is often not actually a real error. Sometimes the "VIOLATION" (of referential integrity) is corrected at a later point ( order of operations is important). Assuming the VIOLATION is corrected , then in DEFERRED m

[sqlite] SQLite slows by a factor of 1000 after foreign key violation

2015-10-01 Thread Andrew Cunningham
I have noticed that when FOREIGN KEY is in DEFERRED mode and a FOREIGN KEY violation occurs, SQLite will continue to run, but performance slows down by about 1000x. Breaking into the code shows that it seems to be continually re-reading the database. When I finally get to COMMIT , an exception is t