Skip to content

Push REINDEX down into driver so reindexer works on SQLite#911

Merged
brandur merged 1 commit into
masterfrom
brandur-reindex-driver
May 24, 2025
Merged

Push REINDEX down into driver so reindexer works on SQLite#911
brandur merged 1 commit into
masterfrom
brandur-reindex-driver

Conversation

@brandur

@brandur brandur commented May 21, 2025

Copy link
Copy Markdown
Contributor

I realized when #909 that the reindexer isn't currently compatible with
the SQLite driver because SQLite's REINDEX syntax is a little
different, and it doesn't support the CONCURRENTLY keyword. The
reindexer runs once an hour so nothing caught the problem.

Here, push the reindex command down into the driver and add a test for
it. This is a good time to do this since we're changing the driver
interface by the necessity for the next version anyway so we're not
breaking anything that's not already broken.

One outstanding issue is that SQLite can't reindex concurrently so the
reindexer would fully lock the database while it's reindexing the
configured indexes. There's nothing that can be done about this for now,
so we might have to recommend that users running a larger database
disable the reindexer if they're using SQLite.

@brandur brandur requested a review from bgentry May 21, 2025 02:27
I realized when #909 that the reindexer isn't currently compatible with
the SQLite driver because SQLite's `REINDEX` syntax is a little
different, and it doesn't support the `CONCURRENTLY` keyword. The
reindexer runs once an hour so nothing caught the problem.

Here, push the reindex command down into the driver and add a test for
it. This is a good time to do this since we're changing the driver
interface by the necessity for the next version anyway so we're not
breaking anything that's not already broken.

One outstanding issue is that SQLite can't reindex concurrently so the
reindexer would fully lock the database while it's reindexing the
configured indexes. There's nothing that can be done about this for now,
so we might have to recommend that users running a larger database
disable the reindexer if they're using SQLite.
@brandur brandur force-pushed the brandur-reindex-driver branch from fb7390f to e44ebc6 Compare May 24, 2025 00:23
@brandur brandur merged commit 63c3a6b into master May 24, 2025
10 checks passed
@brandur brandur deleted the brandur-reindex-driver branch May 24, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants