mattn / mattn/go-sqlite3

Running pragma optimize on all connections

Open
#984 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
9.2k
Forks
1.2k
Avg merge
19m
Merged PRs (30d)
4

Description

https://www.sqlite.org/lang_analyze.html recommends running

PRAGMA analysis_limit=400;
PRAGMA optimize;

on each DB Connection just before it closes.

However as https://github.com/mattn/go-sqlite3/issues/255 points out, there is no way to do access all connections at the moment.

It's important that this be run on every connection, since each connection stores data about which tables need to be analyzed base on queries it ran.

I wonder if we could expose some API to do this?

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the database/sql connection lifecycle and the SQLite PRAGMA analysis_limit and optimize documentation. Determine how the driver could expose access to every connection and define what should happen before each connection closes; the issue is done when that API is specified and covered by appropriate connection-lifecycle tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
api, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.