mirror of
https://github.com/HarborGuard/HarborGuard.git
synced 2026-02-19 17:04:57 +08:00
Database Optimizations: - Add composite indexes on (cveId, severity, cvssScore) for efficient aggregation - Add GIN trigram indexes on cveId, packageName, description, title for fast ILIKE searches - Add index on (cveId, scanId) for efficient COUNT DISTINCT operations - Enable pg_trgm extension for trigram matching Query Improvements: - Rewrite query to use GROUP BY aggregation instead of window functions - Use DISTINCT ON for efficient top-finding selection per CVE - Eliminate self-join on scan_vulnerability_findings table - Add explicit type casting for Severity enum to text - Reduce intermediate result sets for better performance Frontend Pagination: - Implement server-side pagination with configurable page size (50 items) - Add automatic page reset when filters or search terms change - Integrate with UnifiedTable serverPagination prop - Display total count and current page information - Support combined filtering (severity + search) Performance Impact: - Reduced query execution time through index utilization - Efficient pagination with offset/limit at database level - Proper handling of 414 total vulnerabilities across multiple pages