ditto/packages/db
Chad Curtis baa7968305 Optimize top_authors materialized view for better performance
- Limit materialized view to authors with followers_count > 0 and top 10k records
- Add proper indexes (search GIN, pubkey B-tree, followers_count DESC)
- Use CONCURRENTLY for non-blocking refreshes in cron job
- Reduces sorting overhead and memory usage during refresh

The original materialized view was expensive because it sorted all authors
regardless of follower count. This optimization reduces the dataset to a
manageable size while maintaining search functionality.

Fixes expensive query issue in top_authors materialized view.
2025-09-14 21:11:14 +00:00
..
adapters Automatically fetch missing authors from pool 2025-03-06 14:55:40 -06:00
migrations Optimize top_authors materialized view for better performance 2025-09-14 21:11:14 +00:00
utils Fix db tests 2025-02-16 00:39:00 -06:00
deno.json Set all packages to version 0.1.0 2025-03-03 19:31:41 -06:00
DittoDB.ts ditto/db: make adapters use classes instead of static classes 2025-02-22 15:32:47 -06:00
DittoPgMigrator.ts ditto/db: make adapters use classes instead of static classes 2025-02-22 15:32:47 -06:00
DittoTables.ts feat: add zaps_amount_cashu to event_stats (with tests) 2025-03-25 18:19:40 -03:00
KyselyLogger.ts Also don't log more expected SQL errors 2025-04-29 12:54:36 -05:00
mod.ts db: add TestDB module 2025-03-03 12:21:02 -06:00