Weekly PlanetScale health digest with Linear backlog items
Every Monday we review your production databases, share the top fixes in Slack, and file the high impact ones in Linear.
Every Monday at 8am, on a cron schedule, review the health of our PlanetScale databases and turn the findings into work we will actually do.
Start in PlanetScale with List databases to get every database in our organization. Work out which ones are production databases and review only those, skipping development and sandbox databases.
For each production database, pull two things from PlanetScale. First, List schema recommendations, which returns tailored recommendations in the form of DDL statements generated from query level telemetry, system tables, and the database schema. Second, List branch queries for its production branch, so you have recent query activity to reason about.
Group the recommendations by type: add an index, drop an unused index, drop an unused table, and primary key ID exhaustion risk. Then rank them by likely impact. Use the recent branch query data as your evidence, so a recommendation touching a table or query pattern with high call volume or slow response times ranks above one touching something barely used. Remember that unnecessary indexes are not free: while indexes can drastically improve query performance, having unnecessary indexes slows down writes and consumes additional storage and memory.
Post a single digest to our engineering channel in Slack using Send a Message. One digest per run, not one message per database. Lead with the top items across all databases, and give each one a single line of rationale naming the database and table it affects and why it is worth doing. Group the remaining items by recommendation type underneath, and keep the whole thing skimmable.
The digest must carry this caveat prominently, every single week and not just the first time: once a drop unused index recommendation is opened, it will remain open even if the index is subsequently used. Tell the reader to check current Insights usage data to verify that the index is still unused before permanently dropping it. Never present a drop index item as safe to action on the strength of the recommendation alone.
For anything judged high impact, create a Linear issue with Create Issue so it lands in the backlog instead of getting lost in chat. Put the suggested DDL statement in the issue description, together with the database and branch it applies to, the recommendation type, and the rationale for the ranking. Reference the created issue from its line in the Slack digest so the two do not drift apart. Do not create issues for low impact items, since the point is a backlog people trust rather than an exhaustive dump.
This workflow must never apply DDL itself. It reads, summarizes, notifies, and files tickets. Every schema change stays a human decision, executed by a person after review.
Keep the digest scoped to schema recommendations and query metadata. The PlanetScale API manages platform resources only and cannot read the data inside the databases, so never attempt to query table contents or report on customer data. If a week produces no recommendations, still post a short digest confirming the check ran and everything looks clean.
What does this prompt do?
- Checks your production databases every Monday morning and gathers the improvement suggestions PlanetScale has already generated for them.
- Groups the findings into indexes worth adding, indexes worth removing, unused tables, and tables at risk of running out of ID numbers, then ranks them by likely impact.
- Posts a single digest to your engineering channel with the top items and a one line reason for each, so nobody has to open a dashboard to know what needs attention.
- Turns the high impact items into backlog tickets that spell out the exact change to make, and never touches your database itself.
What do I need to use this?
- A PlanetScale account with at least one production database.
- A Slack workspace and the channel where your engineering team reads updates.
- A Linear account, and the team where new tickets should land.
- Read only access is enough. This workflow reads suggestions and writes messages and tickets, and never makes changes to your database.
How can I customize it?
- Change the timing. Monday at 8am is a good default, but a Friday afternoon slot or a fortnightly cadence works just as well.
- Choose which databases count as production, and which Slack channel and Linear team receive the output.
- Adjust where you draw the high impact line, so more or fewer findings become tickets instead of staying as digest lines.
FAQs
Will this change my database?
Why does the digest tell me to double check before removing an index?
Can it read the data stored inside my databases?
What happens in a week with nothing to report?
Does every suggestion become a ticket?
Related templates
When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.
Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.
Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.
On the first Monday of every month, find the alarms nobody watches and the monitoring you quietly pay for, then get a costed cleanup list in Slack and Linear.
Every Monday, rank the week's matches by expected demand, put the big ones on your venue calendar, and post a rota-ready summary to Slack.
Every Tuesday we pull your best new reviews, draft social captions, email testimonials and product page quotes, then stage them in Notion for approval.
Stop letting database cleanups die in chat.
Get a weekly read on your production databases, with the fixes that matter already written up in your backlog.