The CTE approach returned 0 rows — likely a SQLite/SQLAlchemy interaction with :user_id appearing in multiple CTEs. Reverted to the original correlated-subquery form which is proven correct. The 4 indexes added in the previous commit still apply and will make the per-channel subqueries faster once the DB is indexed on startup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 KiB
27 KiB