Applies to:
Summary
Issue: SQL queries usingproject_logs() time out when scanning large datasets without timestamp constraints, even with other filters applied.
Cause: Without timestamp filters, queries can scan the entire project history regardless of other WHERE conditions.
Resolution: Add a timestamp filter using created or another timestamp column to limit the scan range.
Resolution Steps
Add timestamp filter to your query
Step 1: Add created timestamp constraint
Add acreated filter to your WHERE clause before other conditions.
Step 2: Adjust time range as needed
Modify the interval based on your investigation needs:'1 day', '30 days', etc.
Best practices for project_logs queries
Always include timestamp filters
This is a required best practice for acceptable query performance, not an optional optimization.Start with narrow time ranges
Begin with shorter intervals (e.g.,'1 day') and expand only if necessary.