Other: Run PRAGMA optimize and add indexes for the remaining sort orders
The database has no sqlite_stat1, so the planner picks odd indexes: sorting contacts by name uses idx_crm_contacts_score, and the link count uses idx_links_user_creator. Several sorts build a temp B-tree: contacts by name and email with COLLATE NOCASE (lib/crm.ts:575-578), links by clicks (lib/links.ts:204), and Docs by position. That is cheap today and will not be at 50k rows. First scope: run PRAGMA optimize from the hourly cron, and add indexes on (user_id, first_name COLLATE NOCASE, last_name COLLATE NOCASE) and (user_id, clicks DESC). Priority: low. Effort: S.
Comentarios 0
Sin comentarios todavía.
Ingresá para comentar