{"uid":"cap_fZ4pudEFtISZGSqhIK_6b","slug":"saylor-innovations-guide-library-postgresql-slow-query-diagnosis-9b9f7675","name":"Saylor Innovations Guide Library – PostgreSQL Slow Query Diagnosis","description":"Diagnose slow PostgreSQL queries - EXPLAIN ANALYZE, bad estimates, locks and safe index creation","url":"https://saylorinnovations.com/api/kb/postgres-slow-query-diagnosis?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["id","t","c","body"],"properties":{"c":{"type":"string","description":"Category of the guide"},"t":{"type":"string","description":"Title of the guide"},"id":{"type":"string","description":"Identifier of the record"},"body":{"type":"string","description":"Main body text"},"price":{"type":["number","null"],"description":"Price"},"license":{"type":"string","description":"License identifier"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lQaYHdefsfmAOf-5I_yRg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a diagnostic guide for troubleshooting slow PostgreSQL queries, covering EXPLAIN ANALYZE, bad planner estimates, lock contention, and safe concurrent index creation.","exampleAgentPrompt":"My PostgreSQL queries are running really slowly — can you pull up the diagnostic guide that covers EXPLAIN ANALYZE, bad planner estimates, lock issues, and how to safely create indexes without locking the table?","exampleUseCases":[{"title":"Diagnosing unexpectedly slow API queries","prompt":"Our API response times have spiked and I think it's a slow Postgres query — can you get me the guide on diagnosing slow PostgreSQL queries using EXPLAIN ANALYZE and checking for bad planner estimates?"},{"title":"Resolving database lock contention","prompt":"We're seeing lock waits piling up in our Postgres database during peak traffic — pull up the guide on diagnosing lock contention and how to fix it safely."},{"title":"Adding indexes without production downtime","prompt":"I need to add a new index to a large Postgres table but can't afford downtime — can you fetch the guide on safe concurrent index creation in PostgreSQL?"}],"resultDescription":"A JSON object containing a guide record with a unique ID, title, category label, and a full body text with step-by-step instructions for diagnosing slow PostgreSQL queries — including how to run and interpret EXPLAIN ANALYZE output, identify bad row estimates from the query planner, detect lock contention, and safely create indexes concurrently. Also includes a license identifier and optional price field.","failureModes":["Guide not found or endpoint unavailable — returns error with no body","Payment not processed (x402 payment required) — returns 402 status before content is served","Malformed GET request — may return 400 or empty response","Rate limiting or server error — returns 5xx with no guide content"],"whenToPreferThis":"Choose this endpoint when an AI agent or developer needs structured, authoritative guidance on PostgreSQL slow query diagnosis — specifically when the issue involves reading EXPLAIN ANALYZE plans, correcting bad planner estimates, identifying lock contention, or creating indexes safely. It is preferable to generic search when a curated, reproducible guide is needed on this specific topic at low cost ($0.01 per call).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:23.138Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-guide-library-postgresql-slow-query-diagnosis-9b9f7675"}