Skip to content
Machine Learning
Command

/diagnose-seq-scans

Remedy high seq scans on a table

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

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

@civitai
Ships withcivitai

A repository of models, textual inversions, and more

7.3k52 skills17 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
7.3k
Star history of civitai/civitai on GitHub, a chart by star-history.com

Other commands on civitai.

setup-mention-highlights

setup-mention-highligh…

Command

Sets up VS Code mention highlighting configuration for markdown files. Creates or updates the necessary VS Code workspace files…

@civitai@civitaiInstall Command

More commands from other plugins.

plan

plan

Command

Plan n8n Linear ticket implementation

n8n1d211k
@n8n-io@n8n-ioInstall Command