From 87e7e9f774d7a16c6909bfdff7d32987c701fe55 Mon Sep 17 00:00:00 2001 From: edu4rdshl Date: Mon, 25 May 2026 03:42:56 -0500 Subject: [PATCH] perf: don't load thumbnail_blob in get_raw_item get_raw_item is used by GetItemContent (paste-back) and SetClipboard. Neither caller needs the thumbnail -- they only need the original payload. Excluding thumbnail_blob from the SELECT avoids loading up to ~40 KB of PNG data per paste operation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- strata-daemon/src/db.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/strata-daemon/src/db.rs b/strata-daemon/src/db.rs index be4199a..0876c96 100644 --- a/strata-daemon/src/db.rs +++ b/strata-daemon/src/db.rs @@ -263,11 +263,12 @@ impl Db { Ok(blob.flatten()) } - /// Fetch raw item content for clipboard write-back. + /// Fetch raw item content for clipboard write-back. Does not load + /// thumbnail_blob -- callers only need the original payload. pub fn get_raw_item(&self, id: &str) -> Result> { let conn = lock_conn(&self.conn); let result = conn.query_row( - "SELECT id, mime_type, content_text, content_blob, thumbnail_blob, source_app, created_at + "SELECT id, mime_type, content_text, content_blob, source_app, created_at FROM clipboard_history WHERE id = ?1", params![id], |row| { @@ -276,9 +277,9 @@ impl Db { mime_type: row.get(1)?, content_text: row.get(2)?, content_blob: row.get(3)?, - thumbnail_blob: row.get(4)?, - source_app: row.get(5)?, - created_at: row.get(6)?, + thumbnail_blob: None, + source_app: row.get(4)?, + created_at: row.get(5)?, }) }, ).ok();