Skip to content
Machine Learning
Command

/diagnose-seq-scans

Remedy high seq scans on a table

BOOST
From plugin
civitai
7.3k3 skills15 agents3 commands
Install
$ npx -y skills add civitai/civitai --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/diagnose-seq-scans

Context preview

What this command does when you run it.

Remedy high seq scans on a table

Command definition

diagnose-seq-scans.md
description: Remedy high seq scans on a table
argument-hint: "[table name]"

Your goal is to diagnose why there are high volumes of seq scans in a postgres database. You'll be using the postgres MCP to interact with a read replica of a postgres database.

Workflow

1. To prepare, use context7 to review documentation about views, joins, indexes, seq scans, and available diagnostic and stat tables/queries in postgres 17. 2. Review the structure of the target table: $ARGUMENTS 3. Review existing indexes and their usage (query 3 times with 60 seconds between each query to identify the rate of change in their usage) 4. Review top queries that are utilizing the target table (query 3 times with 30 seconds between each query to identify the rate of change in their call rate) 5. Review all views that are utilizing the target table 6. Review top queries for those views (query 3 times with 30 seconds between each query to identify the rate of change in their call rate) 7. Explain to the user how the table is being used most based on your review and if there are simple indexes or additional cover that needs to be added to indexes suggest it 8. Wait for additional direction from the user

Ships withcivitai

A repository of models, textual inversions, and more

Get the whole plugin

Other commands on civitai.