Administration Status
PostgreSQL Table Row Count Estimates with SQL
Mar 14, 2026 / · 5 min read · postgresql database administration sql queries performance tuning statistics pg_stat_user_tables postgres dba pg_class pg_namespace information_schema ·PostgreSQL Table Row Count Estimates with SQL This PostgreSQL query returns estimated row counts for all user tables, sorted by the largest tables first. It reads from PostgreSQL's cumulative statistics rather than scanning the tables, making it near-instant even on tables with billions of rows. Purpose and Overview …
Read MoreMonitor PostgreSQL Memory Settings with pg_settings
Sep 10, 2025 / · 3 min read · postgresql database administration memory management system monitoring performance tuning sql queries database configuration pg_settings ·PostgreSQL Memory Settings Query: Monitor Database Memory Configuration This PostgreSQL query helps database administrators monitor and analyze memory-related configuration settings in their database instance. By querying the pg_settings system catalog view, you can quickly identify current memory parameters, their …
Read MorePostgreSQL Logging Configuration Query via pg_settings
Sep 9, 2025 / · 3 min read · postgresql database administration logging monitoring sql queries database configuration system settings performance tuning pg_settings ·PostgreSQL Logging Configuration Query - Monitor Database Settings This PostgreSQL query provides database administrators with essential insights into logging configuration parameters by querying the pg_settings system view. The query specifically targets logging-related settings while filtering out WAL (Write-Ahead …
Read MoreInspect PostgreSQL Lock Management Settings with pg_settings
Sep 8, 2025 / · 6 min read · postgresql database administration lock management configuration troubleshooting pg_settings ·Inspect PostgreSQL Lock Management Settings Where pg_locks shows the locks held right now, pg_settings shows the rules that govern them: how long a session waits before PostgreSQL checks for a deadlock, how big the shared lock table is, and when a statement gives up waiting. The query below lists the lock settings with …
Read MorePostgreSQL File Location Settings Query via pg_settings
Sep 7, 2025 / · 3 min read · postgresql database administration sql queries configuration file management system views database tuning postgres dba pg_settings ·PostgreSQL File Location Settings Query Guide This PostgreSQL query helps database administrators examine file location configuration settings by querying the pg_settings system view. It retrieves essential information about where PostgreSQL stores its files and directories. Purpose and Overview The query targets …
Read MorePostgreSQL Error Handling Settings via pg_settings
Sep 6, 2025 / · 3 min read · postgresql database administration error handling configuration system views sql queries database management troubleshooting pg_settings ·PostgreSQL Error Handling Settings Query Guide using pg_settings PostgreSQL's pg_settings system view provides comprehensive information about database configuration parameters, particularly those related to error handling and logging. This query helps database administrators monitor and analyze error-related settings …
Read MoreMonitor PostgreSQL Active Sessions with pg_stat_activity
Aug 25, 2025 / · 11 min read · postgresql sql database monitoring performance queries pg_stat_activity postgres dba ·Monitor PostgreSQL Active Sessions with pg_stat_activity pg_stat_activity is the system view that shows every backend process running against a PostgreSQL server right now — one row per server process, with the client address, the query it is running, how long it has been running, and what kind of backend it is. A …
Read MoreMonitor Running Queries in PostgreSQL using pg_stat_activity
Aug 18, 2025 / · 9 min read · postgresql database sql performance monitoring pg_stat_activity pg_locks ·Monitor Running Queries in PostgreSQL with pg_stat_activity Where pg_stat_statements aggregates queries that already finished and pgBadger reads logs after the fact, pg_stat_activity is the real-time snapshot: one row per server process, showing what each one is doing at the moment the query runs. It is the right …
Read MoreALTER SEQUENCE RESTART WITH in PostgreSQL — Examples
Aug 17, 2025 / · 8 min read · postgresql sql database database-maintenance postgres-sequences postgresql-scripting dba-tips database-tuning pg_class pg_namespace ·Restarting All PostgreSQL Sequences with SQL Script Database administrators often face challenges with PostgreSQL sequences, especially after data has been deleted or when tables have been re-imported. Sequences drive the generation of auto-incrementing values (like primary keys using SERIAL or BIGSERIAL), and …
Read MorePostgreSQL Lock Monitoring Uncover Query Details and Lock Age
Sep 2, 2024 / · 3 min read · PostgreSQL SQL Database Performance Monitoring pg_stat_activity pg_locks ·PostgreSQL Lock Monitoring: Gain Insights into Locks with Query and Age Purpose This PostgreSQL SQL query equips you to monitor locks held by active database sessions along with their associated queries and age. This detailed information proves invaluable for performance tuning, troubleshooting lock conflicts, and …
Read More