PostgreSQL best practices, query optimization, connection troubleshooting, and performance improvement. Load when working with Postgres databases.
Install with Tessl CLI
npx tessl i github:planetscale/database-skills --skill postgresOverall
score
60%
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillEvaluation — 96%
↑ 1.32xAgent success when using this skill
Validation for skill structure
Schema design and data type choices
BIGINT identity PKs
20%
100%
TIMESTAMPTZ not TIMESTAMP
100%
100%
created_at on all tables
100%
100%
CHECK not ENUM for status
0%
100%
JSONB for metadata
100%
100%
FK indexes created
100%
100%
ON DELETE behavior
100%
100%
Singular snake_case tables
100%
100%
Index naming convention
25%
100%
NOT NULL on columns
100%
100%
BIGINT for all FKs
100%
100%
Query optimization and anti-pattern fixes
Q1 no SELECT *
100%
100%
Q1 adds LIMIT
0%
0%
Q2 uses JOIN
100%
100%
Q2 specific columns
100%
100%
Q3 uses EXISTS
0%
100%
Q4 cursor pagination
100%
100%
Q5 range condition
100%
100%
Q5 specific columns
100%
100%
Q6 UNION ALL
50%
100%
Composite index order
100%
100%
Index naming
100%
100%
Partitioning strategy and implementation
PK includes partition key (time)
0%
100%
PK includes partition key (region)
0%
100%
BIGINT identity PKs
0%
100%
TIMESTAMPTZ for timestamps
100%
100%
DEFAULT partition for list
0%
0%
Drop partitions for retention
100%
100%
Pre-create future partitions
100%
100%
pg_partman recommendation
0%
100%
DETACH CONCURRENTLY
0%
100%
Human confirmation warning
30%
100%
JSONB for metadata
100%
100%
MVCC, autovacuum tuning, and bloat remediation
Per-table not global tuning
100%
100%
Scale factor 0.01-0.05
100%
100%
Cost delay 0 for SSD
90%
100%
Cost limit 1000-2000
100%
100%
pg_repack or pg_squeeze
100%
100%
idle_in_transaction timeout
100%
100%
XID age alerting threshold
100%
90%
Never disable autovacuum
100%
100%
Dead tuple diagnostic query
100%
100%
XID age diagnostic query
100%
100%
Long transaction query
100%
100%
Index audit and optimization with N+1 fix
Unused index query excludes unique
25%
100%
Unused index query excludes constraints
0%
100%
Duplicate index detection
100%
100%
Per-table index count
100%
100%
Index count guidelines
25%
100%
Human confirmation for drops
60%
100%
Batch query with ANY/IN
100%
100%
JOIN replaces N+1 articles
100%
100%
JOIN replaces N+1 counts
100%
100%
No SELECT * in fixed code
100%
100%
Specific columns in queries
100%
100%
Stats age caveat
100%
100%
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.