insights: Clean up insight series without a view
Created by: coury-clark
I've been thinking about this lately. It's hard to say for sure, because I can imagine a few scenarios.
- A global (big) insight took a while to calculate. User removes it by accident and quickly adds it back. Do we really want to have to recalculate all of this?
- If a series is orphaned and not referenced by any views, but isn't overly big, it would be nice to just delete it right away.
One thing I've been thinking is to queue up deletes for series say 10 minutes after they are oprhaned. At which point we can check they are still orphaned and remove them. This will solve for 1. but still allow us to clean up unused series.
I'll open a new issue for this.
Originally posted by @coury-clark in https://github.com/sourcegraph/sourcegraph/pull/26744#r737923907