reduce batch size to prevent timeouts#1008
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Greptile Summary
This PR reduces the batch size in database migration 0076_damp_vector.sql from 5000 to 500 records per batch. The migration performs a complex data backfill operation that consolidates cost and execution data from legacy columns into new JSONB columns in the workflow_execution_logs table.
The migration uses a sophisticated approach with recursive Common Table Expressions (CTEs) to traverse hierarchical trace span data and aggregate cost information from nested JSON structures. Each batch involves multiple complex JOINs, recursive operations, and extensive JSONB processing to extract cost data from execution_data->'traceSpans' and nested children spans.
This change addresses performance issues that were likely causing database timeouts and temporary file spills when processing larger batches. The migration fits into the broader database schema evolution, working with the existing workflow_execution_logs table structure to modernize how execution cost data is stored and accessed. The smaller batch size trades processing speed for reliability, ensuring the migration can complete successfully across different database sizes and server configurations.
Confidence score: 4/5
- This PR is safe to merge with low risk as it only reduces batch size for better performance
- Score reflects that the change is conservative and addresses a real performance issue without altering core logic
- Pay attention to migration execution time as smaller batches will take longer to complete
1 file reviewed, no comments
reduce batch size to prevent timeouts
No description provided.