EncryptedList icon indicating copy to clipboard operation
EncryptedList copied to clipboard

Make queries faster and more efficient

Open oneminch opened this issue 10 months ago • 0 comments

  • [ ] only return relevant fields (e.g. search -> id, name, url)
    • [ ] description shouldn't be part of search query
    • [ ] optionally enable FTS using a UI toggle inside filters
  • [ ] index apps on app name and tags on tag name
    • [ ] composite index on app_tags
  • [ ] Remove LOWER() (LIKE is case-insensitive)
  • [ ] cache / store joined tables as a view or a table (instead of performing joins on every request)
    • [ ] utilize triggers to refresh on DML ops
CREATE TABLE merged_table AS
  SELECT col
  FROM table1
  JOIN table2
  JOIN table3;

CREATE TRIGGER update_joined_tables
AFTER INSERT ON table2
BEGIN
    -- Drop the existing joined table if it exists
    DELETE FROM joined_table;

    -- Create the new joined table
    INSERT INTO joined_table
    SELECT *
    FROM table1
    INNER JOIN table2 USING(id);
END;

oneminch avatar Mar 27 '25 16:03 oneminch