Conversation
Add backend controller and frontend dialog to benchmark Redis retrieval time against PostgreSQL execution time for a given query. - redisController: connects to user DB, runs query, caches result in Redis under key query:<queryId>, and measures retrieval time via performance.now() - RedisTestDialog: displays a bar chart comparing pgExecutionTime vs redisRetrievalTime using Recharts
- Add fetchOriginalQuery to UserDatabaseController type - Fetches query text and execution time by queryId, stores on res.locals for use in downstream middleware
- Import redisController - Add POST /run-query/redis route with authenticateUser, fetchOriginalQuery, and runRedisTest middleware
- Rename component and props from QueryComparisonView to QueryComparisonPage - Remove internal handleCompareQueries logic and useEffect, comparison now triggered via onOpenCompare prop - Remove LeanQueryAnalyzer section - Fix percentage calculations to use parseFloat with toFixed(2) - Update import to QueryHistoryDialog
…o onLoadQuery - Rename file and component to QueryHistoryDialog - Add queryId param to onLoadQuery for Redis test support - Remove onCompareWithCurrent prop and per-row Compare button
- Add Tooltip around submit button showing validation message when fields are missing - Add width: 100% to button styles
- Add Redis state and handleRedisTest to call /run-query/redis endpoint - Add Run with Redis button in metrics card - Add queryId state, pass to handleLoadQuery for Redis test support - Replace QueryHistory/QueryComparisonForm with QueryHistoryDialog/QueryComparisonDialog - Add RedisTestDialog for displaying Redis vs PostgreSQL results - Remove LeanQueryAnalyzer and handleAnalyzeQuery logic
…yHistoryDialog - Remove QueryComparisonDialog component - Replace selectedQueries state with selectedQueryIds array - Move comparison selection into QueryHistoryDialog via onToggleSelect and onCompare props - Set queryId from fetchMetrics response for Redis button on fresh queries - Fix useEffect to run once on mount only to avoid infinite loop - Update handleLoadQuery signature to accept id and name params - Remove showComparisonDialog state
- Replace onOpenCompare with onToggleSelect, onCompare, and selectedQueryIds props - Add Checkbox column to each row for selecting queries to compare - Update onLoadQuery signature to accept id and name as first two params - Wrap Compare Queries button in Tooltip, disable unless exactly 2 queries selected - Close dialog automatically when Compare Queries is clicked
- Add recharts bar chart visualizing exec time, total cost, buffer reads, and cache hit ratio - Add color-coded performance summary (green = better, red = worse) - Add "is recommended" caption to indicate which query performed better - Fix card height alignment so both query cards always match the taller one
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Linked issue/ticket
Description
Adds Redis caching performance testing feature that allows users to benchmark PostgreSQL query execution time against Redis cache retrieval time.
Also refactors the query comparison flow — removed the separate QueryComparisonDialog and instead added checkboxes directly in QueryHistoryDialog, allowing users to select exactly 2 queries and compare them inline. The Compare Queries button is disabled until exactly 2 queries are selected.
Also improves the query comparison view — added a bar chart visualizing execution time, total cost, buffer reads, and cache hit ratio side by side, color-coded performance summaries, and an "is recommended" label on each metric to indicate which query performed better regardless of selection order.
Reproduction steps
Testing Redis Performance:
4. Navigate to Query Tester
5. Enter your database URI, query name, and a SQL query, then click Fetch Metrics
6. Once metrics appear, click "Run with Redis" to see the PostgreSQL vs Redis performance comparison
7. Alternatively, open Query History, load a previous query, re-enter your database URI, and click "Run with Redis"
Comparing Queries:
8. Open Query History
9. Use the checkboxes to select exactly 2 queries
10. Once 2 are selected the Compare Queries button will become enabled — click it to view metrics side by side
11. View the color-coded performance summary and bar chart below the metrics tables
Checklist