Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/libs/tinybird/pipes/issue_analysis_copy_pipe.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ SQL >
memberId,
organizationId
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issues-opened'
WHERE type = 'issues-opened' AND toYear(timestamp) >= 1971
Comment on lines 15 to +16
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new toYear(timestamp) >= 1971 predicate is non-sargable in ClickHouse/Tinybird and can prevent partition/primary-key pruning. Prefer a direct range filter like timestamp >= toDateTime('1971-01-01 00:00:00') (or toDate('1971-01-01') if timestamp is a Date) to keep the filter efficient.

Copilot uses AI. Check for mistakes.

NODE issues_closed
SQL >
SELECT sourceParentId, MIN(timestamp) AS closedAt
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issues-closed' AND sourceParentId != ''
WHERE type = 'issues-closed' AND sourceParentId != '' AND toYear(timestamp) >= 1971
GROUP BY sourceParentId
Comment on lines 21 to 23
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: toYear(timestamp) >= 1971 is likely to be less efficient than a direct timestamp range predicate. Consider switching this to timestamp >= toDateTime('1971-01-01 00:00:00') for better query pruning.

Copilot uses AI. Check for mistakes.

NODE issues_comment
Expand Down
Loading