diff --git a/frontend/data/products_seed.db b/frontend/data/products_seed.db index c63b998..7b0b48b 100644 Binary files a/frontend/data/products_seed.db and b/frontend/data/products_seed.db differ diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index f96293e..47cdbcf 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -176,6 +176,12 @@ fn import_seed_products(app: tauri::AppHandle) -> Result { [] ).map_err(|e| e.to_string())?; + // Create indexes for fast name_lower lookups (critical: without this UPDATE takes 60s+) + let _ = main_db.execute_batch( + "CREATE INDEX IF NOT EXISTS idx_products_name_lower ON main.products(name_lower); + CREATE INDEX IF NOT EXISTS idx_seed_name_lower ON seed.products(name_lower);" + ); + // Update KBJU + micronutrients for existing store products (seed already attached above) // Sync nutrients_guessed flag let _ = main_db.execute_batch(