ankane/dexter
66.6
Adequate · 19 September 2026
1.3k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
Dexter is a Ruby-based command-line tool that analyzes PostgreSQL query data to suggest index improvements. It ingests data from various sources, including structured logs (CSV, JSON, SQL), active database connections, and pg\_stat\_statements, using a modular architecture to collect and process queries. The system then orchestrates the analysis to generate index creation recommendations, supporting features like non-concurrent index building and HypoPG integration.
Features
New structured log parsers for CSV, JSON, SQL, and stderr formats
The library now includes dedicated parsers for CSV logs, JSON logs, SQL files, and stderr output, replacing or supplementing the previous monolithic parsing logic. Users can now process structured log files (CSV and JSON) where query details and parameters are extracted from specific columns or fields, parse raw SQL files by splitting on semicolons, and handle stderr-style logs that aggregate multi-line statements and parameters. This change improves parsing accuracy for these specific log formats and ensures empty SQL statements are skipped.
lib/dexter/parsers · high confidence
Architecture
Library code reorganized into modular components
The library has been refactored from a single monolithic file into separate classes and modules. The main entry point now requires a dedicated 'dexter' module, and the previous large Client class has been split into distinct components including a Connection class, a LogParser (renamed SqlLogParser), and separate indexers and resolvers. This change improves code maintainability and separation of concerns without altering the external API.
lib · high confidence
Behavioural changes
Dexter v0.6.3: Complete internal rewrite with modular architecture and Postgres 13+ requirement
Dexter has been rewritten from the ground up to use a modular, class-based architecture (Client, Connection, Collector, Indexer, Processor, etc.) replacing the previous monolithic structure. The tool now strictly requires Postgres 13+ and enforces this at startup. Key behavioral changes include the removal of support for \pg\_stat\_monitor\ and the experimental \--log-table\ option, while adding support for multiple \--statement\ inputs, \--non-concurrently\ index creation, and \--enable-hypopg\. The internal query processing pipeline has been restructured to use a \Collector\ for batching and a \Processor\ for orchestration, improving how queries are collected, filtered, and analyzed for index suggestions.
lib/dexter · high confidence
New modular source architecture for PostgreSQL and log data
The library now uses a dedicated \lib/dexter/sources\ directory to manage data collection, introducing four new source classes: \LogSource\ for parsing CSV, JSON, SQL, or standard error logs; \PgStatActivitySource\ for polling active and completed PostgreSQL queries; \PgStatStatementsSource\ for retrieving aggregated query statistics from \pg\_stat\_statements\; and \StatementSource\ for processing pre-defined SQL statements. This refactoring separates source-specific logic from the main initializer, allowing for more flexible and maintainable data ingestion.
lib/dexter/sources · high confidence
Simplified CLI execution and interrupt handling
The executable entry point has been refactored to use the new \Dexter::Client.start\ method, replacing the previous manual instantiation and rescue block. Additionally, explicit handling for SIGINT (Ctrl+C) interrupts has been added via a trap, ensuring the application exits cleanly with an error status when interrupted, rather than silently ignoring the signal.
exe · high confidence
Test coverage
Added comprehensive test suite for query analysis and index creation; Added test support fixtures for SQL query logs and database schema.
Dependencies
Update dependencies and drop support for Ruby versions below 3
The gem now requires Ruby 3 or higher, dropping support for earlier versions. Key dependencies have been updated: pg\_query is now constrained to version 6, pg to version 1 or higher, and slop to version 4.10.1 or higher. Additionally, csv has been added as a runtime dependency, and development dependencies like rake and minitest have been moved to the Gemfile.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 67.
Lenses
- Code Health 92
- Architecture 69
- Maturity 62
- Readiness 61
- Security 98
Changes since last survey
- 300 commits — 266 feature/other, 34 fixes
By area
- lib/dexter — 118 commits
- (root) — 101 commits
- test/indexing_test.rb — 13 commits
- test/statement_test.rb — 11 commits
- .github/workflows — 10 commits
- test/batching_test.rb — 8 commits
- test/connection_test.rb — 8 commits
- test/input_test.rb — 7 commits
- guides/Linux.md — 6 commits
- test/test_helper.rb — 5 commits
- guides/Hosted-Postgres.md — 4 commits
- test/options_test.rb — 4 commits
- test/create_test.rb — 2 commits
- test/support — 2 commits
- lib/pgdexter.rb — 1 commit
Notable commits
- fix: Fixed CI
- fix: Fixed CI
- fix: Fixed CI
- fix: Fixed CI
- fix: Fixed CI
- fix: Fixed CI
- fix: Fixed CI
- fix: Fixed Docker image for linux/arm64 - fixes #56
- fix: Fixed Docker warning [skip ci]
- fix: Fixed JSON::NestingError - fixes #46
- fix: Fixed benchmark script
- fix: Fixed changelog [skip ci]
- fix: Fixed debug explanation
- fix: Fixed docs [skip ci]
- fix: Fixed error when no database specified [skip ci]
- fix: Fixed error with --pg-stat-statements and --min-calls - fixes #53
- fix: Fixed error with auto_explain - fixes #48
- fix: Fixed error with column types without btree support
- fix: Fixed error with foreign tables - fixes #50
- fix: Fixed error with hypothetical index limit - fixes #49
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ankane/dexter was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 9694251e35fe1eb21fb3c560a42754bfa151a486 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.