Agent skill · Audited from source
Postgres Optimization
skill · rohitg00/awesome-claude-code-toolkitApache-2.0 licenceAudited 11 Oct 2026 · source f03e77eaf446
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit f03e77eaf446 and found no filesystem, network or shell access and no hard-coded secrets. What it does: PostgreSQL optimization including indexes, query plans, partitioning, JSONB operations, and connection pooling
Cite
Cite this page
ModelsAtlas. “Postgres Optimization (rohitg00/awesome-claude-code-toolkit)”. Retrieved 11 Oct 2026. https://modelsatlas.com/skills/rohitg00/postgres-optimization
Trust audit
Audit 0.4.1 · source read 11 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha f03e77eaf446 · 11 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherrohitg00 GitHub userOwner of the repository this skill is read from
- Source folderrohitg00/awesome-claude-code-toolkit/skills/postgres-optimizationThe exact folder we audited
- LicenceApache-2.0As the repository states it
- Commit pinned for this verdictf03e77eaf446A new audit runs when the source changes
- Repository statusNot archivedLast push 152 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: PostgreSQL optimization including indexes, query plans, partitioning, JSONB operations, and connection pooling
---
name: postgres-optimization
description: PostgreSQL optimization including indexes, query plans, partitioning, JSONB operations, and connection pooling
---
# PostgreSQL Optimization
## Index Strategies
```sql
-- B-tree index for equality and range queries (default)
CREATE INDEX idx_orders_customer_id ON orders (customer_id);
-- Composite index (column order matters: equality columns first, range last)
CREATE INDEX idx_orders_status_created ON orders (status, created_at DESC);
-- Partial index (smaller, faster for filtered queries)
CREATE INDEX idx_orders_pending ON orders (created_at)
WHERE status = 'pending';
-- Covering index (avoids table lookup entirely)
CREATE INDEX idx_users_email_name ON users (email) INCLUDE (name, avatar_url);
-- GIN index for JSONB containment queries
CREATE INDEX idx_products_metadata ON products USING GIN (metadata);
-- GiST index for full-text search
CREATE INDEX idx_articles_search ON articles USING GiST (
to_tsvector('english', title || ' ' || body)
);
-- Concurrent index creation (no table lock)
CREATE INDEX CONCURRENTLY idx_large_table_col ON large_table (col);
```
## Reading Query Plans
```sql
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT o.id, o.total, u.name
FROM orders o
JOIN users u ON o.user_id = u.id
WHERE o.status = 'shipped'
AND o.created_at > NOW() - INTERVAL '30 days'
ORDER BY o.created_at DESC
LIMIT 20;
```
Key things to look for in the plan:
- `Seq Scan` on large tables indicates a missing index
- `Nested Loop` with high row estimates suggests missing join index
- `Sort` without `Index Scan` means the sort is happening in memory/disk
- `Buffers: shared hit` vs `shared read` shows cache efficiency
## Partitioning
```sql
CREATE TABLE events (
id BIGINT GENERATED ALWAYS AS IDENTITY,
event_type TEXT NOT NULL,
payload JSONB NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
) PARTITION BY RANGE (created_at);
CREATE TABLE events_2024_q1 PARTITION OF events
FOR VALUES FROM ('2024-01-01') TO ('2024-04-01');
CREATE TABLE events_2024_q2 PARTITION OF events
FOR VALUES FROM ('2024-04-01') TO ('2024-07-01');
-- Index on each partition (inherited automatically in PG 11+)
CREATE INDEX ON events (created_at, event_type);
```
Partition tables with more than 10M rows when queries consistently filter on the partition key.
## JSONB Operations
```sql
-- Query nested JSONB fields
SELECT * FROM products
WHERE metadata @> '{"category": "electronics"}'
AND (metadata ->> 'price')::numeric < 500;
-- Update nested JSONB
UPDATE products
SET metadata = jsonb_set(metadata, '{stock}', to_jsonb(stock - 1))
WHERE id = 'abc';
-- Aggregate JSONB arrays
SELECT id, jsonb_array_elements_text(metadata -> 'tags') AS tag
FROM products
WHERE metadata ? 'tags';
```
## Connection Pooling
```ini
# pgbouncer.ini
[databases]
app = host=localhost port=5432 dbname=app
[pgbouncer]
pool_mode = transaction
max_client_conn = 1000
default_pool_size = 25
min_pool_size = 5
reserve_pool_size = 5
server_idle_timeout = 300
```
Use transaction-level pooling for web applications. Session-level pooling for apps that use prepared statements or temp tables.
## Common Tuning Parameters
```sql
-- Check for slow queries
SELECT query, calls, mean_exec_time, total_exec_time
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;
-- Find unused indexes
SELECT indexrelname, idx_scan, pg_size_pretty(pg_relation_size(indexrelid))
FROM pg_stat_user_indexes
WHERE idx_scan = 0
ORDER BY pg_relation_size(indexrelid) DESC;
```
## Anti-Patterns
- Creating indexes on every column instead of analyzing actual query patterns
- Using `SELECT *` when only a few columns are needed
- Not using `EXPLAIN ANALYZE` to verify index usage
- Storing large blobs in JSONB when a separate table with proper types is better
- Missing connection pooling (each connection uses ~10MB of server memory)
- Running `VACUUM FULL` during peak hours (locks the entire table)
## Checklist
- [ ] Indexes match actual query patterns (check `pg_stat_statements`)
- [ ] Composite indexes ordered: equality, then sort, then range columns
- [ ] `EXPLAIN ANALYZE` run on all critical queries
- [ ] Partial indexes used for frequently filtered subsets
- [ ] Connection pooler (PgBouncer/pgcat) in front of PostgreSQL
- [ ] Table partitioning considered for tables over 10M rows
- [ ] Unused indexes identified and dropped
- [ ] `pg_stat_statements` enabled for query performance monitoringExcerpt, first 4,484 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit f03e77e
git clone https://github.com/rohitg00/awesome-claude-code-toolkit git -C awesome-claude-code-toolkit checkout f03e77eaf446
The author documents no install command, so this uses the repository directly. Our verdict covers commit f03e77eaf446 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
f03e77eaf446
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/rohitg00/postgres-optimization/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All data & analysis skills →rohitg00/awesome-claude-code-toolkit
Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing
rohitg00/awesome-claude-code-toolkit
Route broad or ambiguous AgentKit SEO work to the right module while keeping context scoped. Use when a request spans multiple surfaces, asks for overall digital-presence strategy, involves provider or install…
rohitg00/awesome-claude-code-toolkit
REST API design with resource naming, pagination, versioning, and OpenAPI spec generation
rohitg00/awesome-claude-code-toolkit
Authentication and authorization patterns including OAuth2, JWT, RBAC, session management, and PKCE flows
rohitg00/awesome-claude-code-toolkit
AWS cloud patterns for Lambda, ECS, S3, DynamoDB, and Infrastructure as Code with CDK/Terraform
rohitg00/awesome-claude-code-toolkit
CI/CD pipeline patterns for GitHub Actions, GitLab CI, testing strategies, and deployment automation
Add this badge to your README
[](https://modelsatlas.com/skills/rohitg00/postgres-optimization/)
<a href="https://modelsatlas.com/skills/rohitg00/postgres-optimization/"><img src="https://modelsatlas.com/skills/rohitg00/postgres-optimization/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Postgres Optimization
What does the Postgres Optimization skill do?
Is Postgres Optimization safe to install?
What can Postgres Optimization access on my machine?
How current is this page?
Sources
- github.com/rohitg00/awesome-claude-code-toolkit/tree/main/skills — the audited source at commit f03e77eaf446 and every finding aboveObserved · 11 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Postgres Optimization skill do?
- Is Postgres Optimization safe to install?
- What can Postgres Optimization access on my machine?