René's URL Explorer Experiment


Title: sqlite: statements with JOINs are re-prepared on every run since SQLite 3.54 (sqlite3_clear_bindings) · Issue #66800 · nodejs/node · GitHub

Open Graph Title: sqlite: statements with JOINs are re-prepared on every run since SQLite 3.54 (sqlite3_clear_bindings) · Issue #66800 · nodejs/node

X Title: sqlite: statements with JOINs are re-prepared on every run since SQLite 3.54 (sqlite3_clear_bindings) · Issue #66800 · nodejs/node

Description: Version v26.12.0 Platform Linux 6.17 aarch64 (also expected on other platforms; the cause is not platform specific) Subsystem sqlite What steps will reproduce the bug? import { Database } from 'node:sqlite'; const db = new Database(':mem...

Open Graph Description: Version v26.12.0 Platform Linux 6.17 aarch64 (also expected on other platforms; the cause is not platform specific) Subsystem sqlite What steps will reproduce the bug? import { Database } from 'nod...

X Description: Version v26.12.0 Platform Linux 6.17 aarch64 (also expected on other platforms; the cause is not platform specific) Subsystem sqlite What steps will reproduce the bug? import { Database } from '...

Opengraph URL: https://github.com/nodejs/node/issues/66800

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: statements with JOINs are re-prepared on every run since SQLite 3.54 (sqlite3_clear_bindings)","articleBody":"### Version\n\nv26.12.0\n\n### Platform\n\nLinux 6.17 aarch64 (also expected on other platforms; the cause is not platform specific)\n\n### Subsystem\n\nsqlite\n\n### What steps will reproduce the bug?\n\n```js\nimport { Database } from 'node:sqlite';\nconst db = new Database(':memory:');\ndb.exec('create table t (id integer primary key, h text); create table p (id integer primary key, a integer)');\nconst insT = db.prepare('insert into t values (?, ?)');\nconst insP = db.prepare('insert into p values (?, ?)');\nfor (let i = 1; i \u003c= 1000; i++) { insT.run(i, 'x'); insP.run(i, i); }\nfor (const sql of ['select h from t where id = ?', 'select t.h from p join t on t.id = p.a where p.id = ?']) {\n  const st = db.prepare(sql);\n  const t0 = performance.now();\n  for (let i = 0; i \u003c 100_000; i++) st.get(1 + (i % 1000));\n  console.log(sql, ((performance.now() - t0) * 1000 / 100_000).toFixed(2), 'us/op, reprepare =', st.stat('reprepare'));\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways, for statements where SQLite 3.54's planner marks a bound parameter for\nre-optimization (e.g. a JOIN filtered by `rowid = ?`).\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe statement is prepared once and reused, as on v24.21.0 (SQLite 3.53.4).\n\n### What do you see instead?\n\n```\nv24.21.0 (SQLite 3.53.4)  join: 2.14 us/op   (same script with DatabaseSync; no stat() on v24)\nv26.12.0 (SQLite 3.54.0)  join: 8.44 us/op, reprepare = 100000\n                          single table: 1.53 us/op, reprepare = 0 (unchanged)\n```\n\n### Additional information\n\n`Statement::BindParams()` and `SQLTagStore::ResetAndBindStatement()` call `sqlite3_clear_bindings()`\nbefore every execution. In SQLite 3.54, `sqlite3_clear_bindings()` expires any\nstatement whose `expmask` is non-zero, without honouring the new `smimask`\n\"only re-prepare on change to/from 0 or 1\" rule that `sqlite3_bind_*()` honours.\n3.54 sets `expmask` for ordinary JOIN statements, so they are re-prepared on every\n`sqlite3_step()`. A plain C repro (no Node involved) shows the same thing:\n3.54.1 with `clear_bindings` re-prepares 200000/200000 runs; without it, 8.\n\nThis is also being reported on the SQLite forum; I'll link the thread in a comment.\n\nIndependently of an upstream fix, node:sqlite could avoid the unconditional\n`sqlite3_clear_bindings()` call, e.g. only clear when fewer parameters are bound\nthan `sqlite3_bind_parameter_count()`, or bind NULL explicitly to the remaining\nones. This also matters for LTS lines once SQLite 3.54 is backported (deps update\nwas #66663).\n","author":{"url":"https://github.com/Glasden","@type":"Person","name":"Glasden"},"datePublished":"2026-10-16T19:01:02Z","url":"https://github.com/nodejs/node/issues/66800"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0823d1ee-66f0-1585-8bf5-2404c6d134c1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA1D6:61676:A337E:DF088:6AED3357
html-safe-nonced0cf090bac0e3646d504d15febabe93e4bd60c2099e8335395192478d3db99e0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUQ2OjYxNjc2OkEzMzdFOkRGMDg4OjZBRUQzMzU3IiwidmlzaXRvcl9pZCI6IjQ4NzMyNzExODgwNjc3OTE3MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace43f3d3ba9dc0e63f0203e14c35c04c3fa4b2e87fa37d470c2315c2660caec0d
hovercard-subject-tagissue:5889654550
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66800/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e5464a773212048c3f591a80f15ceabd2accfe06acdc23a81c3477406548c92b/nodejs/node/issues/66800
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e5464a773212048c3f591a80f15ceabd2accfe06acdc23a81c3477406548c92b/nodejs/node/issues/66800
og:image:altVersion v26.12.0 Platform Linux 6.17 aarch64 (also expected on other platforms; the cause is not platform specific) Subsystem sqlite What steps will reproduce the bug? import { Database } from 'nod...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameGlasden
hostnamegithub.com
expected-hostnamegithub.com
Nonee51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ebb7b901cc154ecc179a44f266fcf69f343b30
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/66800#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66800
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66800
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/66800
Reloadhttps://github.com/nodejs/node/issues/66800
Reloadhttps://github.com/nodejs/node/issues/66800
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests665 (665)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66800
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66800
sqlite: statements with JOINs are re-prepared on every run since SQLite 3.54 (sqlite3_clear_bindings)https://github.com/nodejs/node/issues/66800#top
https://github.com/Glasden
Glasdenhttps://github.com/Glasden
on Oct 16, 2026https://github.com/nodejs/node/issues/66800#issue-5889654550
#66663https://github.com/nodejs/node/pull/66663
https://github.com/Glasden
Glasdenhttps://github.com/Glasden
on Oct 16, 2026https://github.com/nodejs/node/issues/66800#issuecomment-6222941230
https://sqlite.org/forum/forumpost/e9fa3f80d5https://sqlite.org/forum/forumpost/e9fa3f80d5
https://github.com/Glasden
Glasdenhttps://github.com/Glasden
on Oct 17, 2026https://github.com/nodejs/node/issues/66800#issuecomment-6231651433
535a77cf5ahttps://sqlite.org/src/info/535a77cf5a8e1a7b
drh's replyhttps://sqlite.org/forum/forumpost/b4f0958dac
dualfrozhttps://github.com/dualfroz
on Oct 19, 2026https://github.com/nodejs/node/issues/66800#event-33638382449
sqlite: avoid sqlite3_clear_bindings() before every runhttps://github.com/dualfroz/node/commit/93efeb8943f7f3c62f53172955f1db7a983b88a5
93efeb8https://github.com/dualfroz/node/commit/93efeb8943f7f3c62f53172955f1db7a983b88a5
sqlite: avoid sqlite3_clear_bindings() before every runhttps://github.com/dualfroz/node/commit/79ed629ebe650d9d3498b3a83cef56d3e518ffd7
79ed629https://github.com/dualfroz/node/commit/79ed629ebe650d9d3498b3a83cef56d3e518ffd7
nodejs-github-bothttps://github.com/nodejs-github-bot
on Oct 26, 2026https://github.com/nodejs/node/issues/66800#event-34274417657
sqlite: avoid sqlite3_clear_bindings() before every runhttps://github.com/nodejs/node/commit/eb663fe6f4d8eceed2558d02d5e0c179beb86a93
eb663fehttps://github.com/nodejs/node/commit/eb663fe6f4d8eceed2558d02d5e0c179beb86a93
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/66800
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66800
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.