SShortSingh.
Back to feed

PostgreSQL's built-in system views can diagnose slow queries without extra tools

0
·1 views

A developer at Atlas built a lightweight PostgreSQL Index Monitor after repeatedly running manual SQL queries to investigate database performance issues. PostgreSQL continuously logs performance data in system views such as pg_stat_user_tables and pg_stat_user_indexes, which can be queried with a basic read-only database user. These views reveal critical details like unused indexes, vacuum status, and write overhead — no APM agent, paid dashboard, or database extension required. The author highlights that unused indexes still consume disk space and slow down every write operation, making their identification an important optimization step. A key caveat noted is that scan counters are cumulative since the last statistics reset, so apparent zero-use indexes should be verified against the age of the stats before any index is dropped.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

DEV Community Post Urges Developers to Act on Regrets Rather Than Accept Defeat

A DEV Community member named FrancisTR published a reflective post on June 22 addressing a common mindset among developers and students who acknowledge their shortcomings but fail to take action. Drawing from a Virtual Coffee group conversation with fellow developers, the author noted how discussions about regrets — such as skipping networking or doing only the bare minimum in college — often reveal a pattern of inaction. While acknowledging real challenges like a competitive job market and the rise of AI, the post argues that luck alone does not determine outcomes and that consistent effort within a supportive community can shift the odds. The author cited a peer's six-month journey of extreme dedication — including sacrificed evenings and weekends — as evidence that sustained personal effort yields results. The central message, inspired by a quote from the film Ip Man, is that success in a developer's career ultimately comes down to the individual's own choices and drive.

0
ProgrammingDEV Community ·

New Tools Target AI Agent Hallucinations, Code Gen Workflows, and Enterprise Auth

This week's developer-focused roundup covers three key advances in applied AI. Real-world deployments of AI agents have revealed a persistent problem where agents falsely report tasks as completed, and practitioners are sharing architectural fixes involving better error handling and state verification. A developer has released SVI, a new tool designed to reduce the time spent on prompt engineering when using LLMs like ChatGPT for code generation across multiple files. On the enterprise side, a significant update to an authentication protocol aims to strengthen security and governance for AI systems in production. Together, these developments reflect growing industry effort to make AI agents and tools more reliable, efficient, and secure for real-world use.

0
ProgrammingDEV Community ·

Developer Builds Dropshipping Automation Pipeline, Shares Engineering Lessons Learned

A software developer built a dropshipping automation pipeline using Node.js and PostgreSQL to explore the technical challenges of the e-commerce model. The system pulled product data from multiple supplier APIs and handled tasks like inventory syncing, dynamic pricing, and order routing. While automation and price monitoring proved highly effective, inconsistent supplier APIs and race conditions in inventory sync created significant hurdles. The developer also ran A/B tests on product images, finding that small creative changes produced measurable improvements in engagement. The key takeaway was to treat dropshipping as an engineering problem rather than a business shortcut, noting that the skills gained — API integration, data pipelines, and automation — are broadly transferable.

PostgreSQL's built-in system views can diagnose slow queries without extra tools · ShortSingh