Comments (2)
I wanted to follow up to let you know that I believe this is a sqlite issue and not something specific to go-sqlite3. After discovering that the "explain query plan" differed between the two tests, with the built-in version omitting a "USING AUTOMATIC COVERING INDEX", I downloaded and built sqlite3 v3.42.0 and reproduced the slow behavior there as well. I plan to spend some more time tomorrow going through the changelogs for sqlite to see if I can figure out what version introduced the change. Note: 3.40.1 is fine, as is 3.44.0 prerelease, so it seems to be a regression somewhere in there. Thanks for go-sqlite3!
from go-sqlite3.
Just for anyone who happens to stumble upon this post. Below are the commits that introduced the performance regression into sqlite and corrected it.
Introduced by:
commit 7d5a5491215eb48acba22a81067aae2661bb2fd6
Author: drh <>
Date: Thu Mar 16 10:17:30 2023 +0000
Do not use the one-pass optimization on an UPDATE if there is a subquery
in the WHERE clause, since if the subquery is hidden behind a short-circuit
operator, the subquery might not be evaluated until after one or more rows
have been updated. Fix for the problem reported by
[forum:/forumpost/0007d1fdb1|forum post 0007d1fdb1]. This is the same
problem that was fixed by [73f0036f045bf371] only for UPDATE instead of
DELETE.
FossilOrigin-Name: 2c56b984a0bd3be5ec326a2109ea7b8f1d4ef63c8fc325caac9663cf2479eaff
Fixed by:
commit d192b4441de853d23fd377244dfcfbaa5b246ba7
Author: drh <>
Date: Tue Aug 1 00:34:03 2023 +0000
Restore part of the UPDATE one-pass optimization that was removed by
check-in [2c56b984a0bd3be5]: only disable one-pass if the WHERE clause
contains a subquery. Allow subqueries in the SET expressions.
Fix for performance problem reported by
[forum:/forumpost/8ab195fd44e75ed0|forum post 8ab195fd44e75ed0].
FossilOrigin-Name: 42916af9fc0f379a608a08db894400bd735a28e26ab1ffd604d1fddfbdb3ec0c
from go-sqlite3.
Related Issues (20)
- v3.45.1 release HOT 1
- Scanning of timestamps not working when using "with time zone"
- Support for custom window functions
- Drop static_mock.go
- Getting Errors with go-sqlite3 HOT 4
- env “TMPDIR" can't change the tmp store diretory HOT 7
- "NOT json_valid(NULL)" unexpected empty result (works in CLI) HOT 2
- docker build fail undefined: sqlite3.Error HOT 2
- Database file does not get created when using connection string HOT 4
- Cannot read result row of pragma wal_checkpoint HOT 4
- importing go-sqlite hangs my application!!?? HOT 2
- Inconsistent parsing of DATETIME type, causing errors HOT 7
- C code errors on linux amd64
- exec for update does not correctly return sql.Results HOT 1
- Can't seem to fuzz SQLite?? HOT 1
- sqlite3 in-memory mode deletes data and releases memory
- x86编译问题
- It doesn't create a new database file if opened in a `network drive` with `:encrypted.db?_key`.
- Flagged by Windows Defender since v1.14.20 HOT 2
- Race conditions during unit tests despite workarounds HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sqlite3.