mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 06:25:54 +03:00
[PR #425] [MERGED] Improve performance for sqlite queries #592
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#592
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-shiori/shiori/pull/425
Author: @Orhideous
Created: 5/10/2022
Status: ✅ Merged
Merged: 8/8/2022
Merged by: @fmartingr
Base:
master← Head:fix/performance📝 Commits (10+)
7a6d59e[sqlite] Added has_content column and relevant migration8a03f02Fix typo in docstring81927f4[sqlite] Fetch content for bookmarks separately4619813[sqlite] Store has_content alongside with bookmarkbf18635[sqlite] Rename variable to distinguish it from main query7e3be82[sqlite] Use by-reference instead of no-op copybdd2712[sqlite] Reduce queries count from ≈30 to 1 to fetch tagsc928a5dLint fixesb6d0541Make minor logging improvements204f316Wrap entire migration in transaction block📊 Changes
5 files changed (+105 additions, -39 deletions)
View changed files
📝
internal/database/database.go(+1 -1)➕
internal/database/migrations/sqlite/0002_denormalize_content.down.sql(+3 -0)➕
internal/database/migrations/sqlite/0002_denormalize_content.up.sql(+8 -0)📝
internal/database/sqlite.go(+92 -37)📝
internal/webserver/server.go(+1 -1)📄 Description
This PR is intended to address a range of performance regressions for the SQLite database.
Namely:
Tested manually on 3k bookmarks with content. Last version (7394b10) returned main page in a second or two. Now it takes few, maybe tens of milliseconds.
Note that migration is required:
shiori migrate.Built an image for the test, now I use it myself:
docker.io/orhideous/go-shiori:1.5.2-perf-fixP.S. There is definitely a room for improvement for another databases.
Fixes #408
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.