Skip to content

Add precompute tables for uploads and pending posts#3

Merged
clragon merged 17 commits intomainfrom
precompute
Jan 1, 2026
Merged

Add precompute tables for uploads and pending posts#3
clragon merged 17 commits intomainfrom
precompute

Conversation

@clragon
Copy link
Copy Markdown
Member

@clragon clragon commented Dec 28, 2025

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a comprehensive tiling and lifecycle tracking system for upload and post data. The changes add precomputed aggregation tables that improve query performance for time-series metrics and implement a job queue system with support for multiple independent queues.

Key changes include:

  • Implementation of hourly tile aggregation for upload counts with background workers for data generation
  • Creation of a post lifecycle table that tracks upload, approval, deletion, and permit timestamps in a single denormalized structure
  • Enhancement of the job service to support multiple named queues that process jobs independently
  • Addition of health monitoring endpoints for tracking tile coverage and data availability

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/upload/tiles/* New upload tiles module with entity, service, worker, and module for aggregating upload counts by hour
src/post/lifecycle/* New post lifecycle module that denormalizes post state changes into a single table for efficient querying
src/post/metric/post-metric.service.ts Refactored to use lifecycle table with raw SQL queries for pending post calculations
src/upload/metric/upload-metric.service.ts Split count methods to use tiles for general counts and direct queries for per-uploader metrics
src/job/job.* Enhanced job service to support multiple independent queues instead of single global queue
src/common/tile.ts New shared utilities for tile generation, range calculation, and missing tile detection
src/health/tiles/* New tile health monitoring system with endpoints to check tile coverage and delete stale data
src/migration/* Database migrations for new tables (upload_hourly_tiles, post_lifecycle) and manifest updates
src/common/date/date-buckets.ts Added helper functions for generating series points from tile data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@clragon clragon merged commit 5d4d81d into main Jan 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants