Docs are not available for mobile use. Please use a desktop computer to view the documentation.
Boundary Detection Runs
Batch processing metadata for boundary detection operations
Purpose
The boundary_detection_runs
table tracks the execution and performance of boundary detection batch processes. It provides metadata about detection runs, including timing, processing statistics, and execution status for monitoring and optimization purposes.
Schema Definition
Field | Type | Description | Constraints |
---|---|---|---|
id | uuid | Unique run identifier | Primary key, auto-generated |
userId | uuid | User whose data was processed | Foreign key to users.id |
runDate | timestamptz | Date/time of the detection run | Not null |
status | detection_status | Current run status | Default: ‘pending’ |
totalSignalsProcessed | integer | Number of signals analyzed | Optional |
boundariesDetected | integer | Number of boundaries found | Optional |
processingTimeMs | integer | Total processing time in milliseconds | Optional |
startTime | timestamptz | When processing began | Optional |
endTime | timestamptz | When processing completed | Optional |
createdAt | timestamptz | Record creation timestamp | Auto-generated |
Relationships
References:
users.id
viauserId
- User whose data was processed
Enumeration Values
Detection Status
pending
- Run is scheduled but not startedcompleted
- Run finished successfullyfailed
- Run encountered errors and failed
Usage Examples
Get recent detection runs for a user
SELECT runDate, status, totalSignalsProcessed, boundariesDetected, processingTimeMs
FROM boundary_detection_runs
WHERE userId = 'user-uuid'
ORDER BY runDate DESC
LIMIT 10;
Monitor run performance
SELECT
DATE_TRUNC('day', runDate) as day,
COUNT(*) as total_runs,
COUNT(*) FILTER (WHERE status = 'completed') as successful_runs,
COUNT(*) FILTER (WHERE status = 'failed') as failed_runs,
AVG(processingTimeMs) FILTER (WHERE status = 'completed') as avg_processing_time_ms
FROM boundary_detection_runs
WHERE userId = 'user-uuid'
AND runDate >= NOW() - INTERVAL '30 days'
GROUP BY day
ORDER BY day;
Find long-running processes
SELECT
id,
runDate,
status,
startTime,
endTime,
EXTRACT(EPOCH FROM (COALESCE(endTime, NOW()) - startTime))*1000 as actual_duration_ms,
processingTimeMs
FROM boundary_detection_runs
WHERE userId = 'user-uuid'
AND startTime IS NOT NULL
AND (
status = 'pending' OR
EXTRACT(EPOCH FROM (COALESCE(endTime, NOW()) - startTime))*1000 > 300000 -- > 5 minutes
)
ORDER BY startTime DESC;
Analyze detection efficiency
SELECT
status,
AVG(totalSignalsProcessed) as avg_signals,
AVG(boundariesDetected) as avg_boundaries,
AVG(processingTimeMs) as avg_time_ms,
AVG(CASE
WHEN totalSignalsProcessed > 0
THEN processingTimeMs::float / totalSignalsProcessed
ELSE NULL
END) as avg_ms_per_signal
FROM boundary_detection_runs
WHERE userId = 'user-uuid'
AND status = 'completed'
AND runDate >= NOW() - INTERVAL '30 days'
GROUP BY status;
Find failed runs for troubleshooting
SELECT runDate, startTime, endTime, totalSignalsProcessed, processingTimeMs
FROM boundary_detection_runs
WHERE userId = 'user-uuid'
AND status = 'failed'
ORDER BY runDate DESC;
Get processing statistics
SELECT
COUNT(*) as total_runs,
SUM(totalSignalsProcessed) as total_signals,
SUM(boundariesDetected) as total_boundaries,
AVG(boundariesDetected::float / NULLIF(totalSignalsProcessed, 0)) as avg_boundaries_per_signal
FROM boundary_detection_runs
WHERE userId = 'user-uuid'
AND status = 'completed'
AND runDate >= NOW() - INTERVAL '30 days';
Monitor current processing
SELECT
id,
runDate,
startTime,
EXTRACT(EPOCH FROM (NOW() - startTime))*1000 as elapsed_ms,
totalSignalsProcessed
FROM boundary_detection_runs
WHERE status = 'pending'
AND startTime IS NOT NULL
ORDER BY startTime;