DB Statistics Collector (dbstat) is a PostgreSQL extension that collects table metrics such as exact row count, and the timing of insert/update/delete statements.
This is a learning exercise in the use of libpq and C-based extensions.
- PostgreSQL 9.6+
- gcc
- development packages for postgres
- Checkout the dbstat source from github.
- Ensure that pg_config is in the user's path
- As root, run 'make install' with dbstat.control in your cwd.
- Run 'make' to compile dbstat
- Login to the target database server.
- Run 'CREATE EXTENSION dbstat;'
- Start dbstat with the connection parameters to the target DB server/instance.
Note: You may need to symlink the libpq-fe.h file to /usr/includes. This file is typically located in: /usr/pgsql-version/includes/
- Multithreaded listeners
- SIGHUP handler reloads and reissues listeners
- Supports NoSQL / KV store backends for statistics
Initial version