diff --git a/crates/ipx/CHANGELOG.md b/crates/ipx/CHANGELOG.md index 5a74c93..1aada34 100644 --- a/crates/ipx/CHANGELOG.md +++ b/crates/ipx/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Counting the files waiting to download, which the status and the metrics do every 30 seconds, reads only those files instead of every one ipx knows of: about 1 ms instead of 90 (#489). - Downloading a season takes back the files of it retention removed, rather than queuing nothing, and no file on its way already is queued twice (#483). - A feed an OPML stops listing leaves All Subscriptions with it, rather than its items staying there with no feed name beside them: the scan no longer reads it again after the list drops it, and its subscriptions go with it, as they do when a feed is removed with `ipx rm`. Any left from before are removed when ipx starts (#478). - Searching All Subscriptions answers in a fraction of a second, not five: a search reads each item's title and text without its markup, indexed on Postgres, and still finds part of a word. It no longer matches words inside the HTML's tags, such as a link's address. Text past the first 4,000 characters of a very long post is not searched (#459, #472). diff --git a/crates/ipx/src/db.rs b/crates/ipx/src/db.rs index a064b8b..4758a9c 100644 --- a/crates/ipx/src/db.rs +++ b/crates/ipx/src/db.rs @@ -84,6 +84,9 @@ async fn create_missing(orm: &DatabaseConnection) -> Result<()> { // files through enclosures_entry read every file row of their feeds, 58 ms a feed list // (#165). Also what the healthcheck's count and the Downloaded filter look for. "CREATE INDEX IF NOT EXISTS enclosures_on_disk ON enclosures (feed_id, guid) WHERE path IS NOT NULL", + // The few files waiting to download, which the status counts every 30 s: without it, a + // scan of all 690,000 enclosures, 92 ms each time, to find a handful (#489). + "CREATE INDEX IF NOT EXISTS enclosures_pending ON enclosures (id) WHERE state = 'pending'", "CREATE UNIQUE INDEX IF NOT EXISTS users_name_lower ON users (lower(name))", // Every key and date an item list sorts by, so `entries_where` pages from the index alone // and visits the table only for the rows it shows. Sorting All Subscriptions from the