Database checks
The Database advisor runs 56 fixed, on-demand checks over the physical schema reported by the application's JDBC datasources, supplemented by vendor catalogs, available JPA declarations, already-retained SQL Trace observations, the JDBC driver settings configured in the URL and the connection pool, the connection pool compared with the server's limits, and a few of the database server's own settings. It never executes DDL, advances a sequence, queries application rows or starts work on page load.
These are structural observations and review prompts, not workload forecasts, business-model validation or automatic migration instructions. A finding describes the available evidence, not everything the database could contain. See the advisor page for availability.
Reading more than the preview
The ten-entry sampleViolations preview does not cap violationCount. View violations and GET <api>/database-advisor/rules/{id}/violations?scanId=...&offset=0&limit=100 retrieve sanitized details already retained by that scan without borrowing connections or querying the database. Retrieval truncation is separate from schema/observation bounds; see snapshot, retention, and MCP/CLI retrieval.
Availability and bounds
A known-findings score can remain usable with unread schemas or missing metadata, without treating those gaps as passes. See the shared score eligibility policy.
Spring MVC, Spring WebFlux and Quarkus use the same engine and report contract. Native adapters discover and de-duplicate datasource beans, including supported routing, delegating and SQL Trace wrappers. A successfully empty inventory returns DISABLED; failed discovery returns ERROR, not a claim that no datasource exists. Individual bean failures remain visible alongside successfully discovered pools. If a vendor query fails mid-stream, that query's rows are discarded and its failure is diagnosed; successful JDBC metadata and independent catalog families remain available. A normal row/deadline bound instead retains the observed prefix with incomplete coverage.
The limits are 300 tables, 300 columns and 100 indexes per table, 500 rows per vendor finding query, 5,000 rows per vendor schema-enrichment query, a cooperative 20-second scan budget, and a 5-second catalog statement timeout clamped to the remaining budget. Bounded reads detect truncation rather than treating the retained prefix as a complete inventory. Metadata row processing also has finite bounds. JDBC timeouts have second-level granularity. The table-inventory bound counts raw rows, including filtered relations and advertised views; a very small bound can retain zero application tables without establishing that none exist.
The scan budget is not a hard wall-clock guarantee. Connection acquisition and JDBC-driver metadata calls cannot necessarily be interrupted by BootUI. No background JDBC workers or pool-wide timeout changes are introduced to simulate cancellation. The connection's original read-only state is restored when known; unsupported hints and failed restoration are reported rather than silently ignored.
What "could not be checked" looks like
- Datasources report
AVAILABLE,PARTIALorFAILED, with product, dialect and diagnostics. - Unknown, failed, unsupported and truncated metadata are distinct from a confirmed absence. A completed JDBC method is not a universal guarantee that the driver/role reports every object.
- Rule results contain findings only. A rule with no eligible evidence is
SKIPPED, not a fabricatedPASS; missing coverage can be reported separately while retaining confirmed findings. - The scan is
PARTIALwhen metadata or required evidence is incomplete, andERRORwhen no discovered schema could be read. Normal wrong-dialect or absent optional-feature skips are informational. - An absent JPA integration is a neutral skip; a failed metamodel discovery is incomplete evidence even when it discovers no entities. Missing JDBC driver name, version or URL evidence and an incomplete PostgreSQL relation inventory also prevent a complete assessment.
- A PostgreSQL-only inventory makes MySQL/MariaDB and Oracle rules not applicable, not incomplete: their
SKIPPEDcounters andINFOdiagnostics remain, but they earn no completed-check credit and add no assessment limitations. An applicable vendor's unavailable/version-unsupported catalog is different: it records missing coverage even when the rule returns early, including mixed readable/unsupported datasource inventories. A feature known not to exist is still inapplicable (for example, publications before PostgreSQL 10); an unknown server version cannot establish that absence. Failed product identification also leaves applicability unknown. Assessment limitations summarize warning/error diagnostics, never these neutral wrong-vendor notes. - Diagnostics are bounded and credential-redacted. They do not count as violations. Report status remains available to the shared scoring policy independently of retained findings and dismissals.
Qualified catalog identities preserve case and component boundaries: quoted names and dots inside names must not collide. Composite keys preserve child-to-parent pairing and validated sequence order. An ambiguous anonymous composite FK cannot safely be reconstructed from adjacent JDBC rows.
Finding identity
Every finding has a canonical identity, used to compare a scan with the previous one (Changes since the previous scan). It is v1: followed by percent-encoded parts joined with |, derived from the physical object and never from the message, a value or SQL text:
| Finding about | Identity parts |
|---|---|
| A table | ds=<datasource>, catalog=, schema= (when reported), table=<name> |
| An index, constraint or column | the table parts, then index=, fk=, constraint=, column= or partition= |
| A pair (duplicate index or key) | the table parts, then both names in sorted order, so the pair has one identity |
| A sequence | ds=<datasource>, schema=, sequence= |
| A Hibernate mapping mismatch | the resolved table parts, then attribute= and column= (or columns=, unique=, indexcolumn=) |
| A mapped entity with no table or sequence | ds=<datasource>, then entity=<entity>, then relation=, secondary= or attribute= + sequence= |
| A runtime SQL shape (DB-RUNTIME-001) | shape=<digest of the normalized statement> |
| A JDBC driver setting (DB-DRIVER-001..010) | ds=<datasource>, then setting=<setting name> (setting=cachePrepStmts for DB-DRIVER-004); never a value |
| A connection-pool setting (DB-POOL-001..003, 005) | ds=<datasource>, then pool=idle-limit, pool=maximum-size, pool=max-lifetime or pool=connection-timeout; never a value |
| A database-server setting (DB-SERVER-001, 003..005, 007..008) | ds=<datasource>, then server=<setting name> (server=pg_stat_statements for DB-SERVER-004); never a value |
Catalog, schema and table are separate parts, so a table named a.b cannot alias table b of schema a. A comparison never claims a finding is resolved for DB-RUNTIME-001, because its evidence is the SQL Trace window, or for a rule or datasource the scan could not fully read. The same identity is what a single-finding dismissal is matched on.
Severity scale
| Severity | Meaning |
|---|---|
| HIGH | A concrete integrity or availability concern, such as an explicitly invalid index, a generator frontier near its effective bound, or missing declared uniqueness. |
| MEDIUM | A structural discrepancy that needs contextual review. |
| LOW | A limited-evidence or lower-impact review prompt, such as exact index-definition overlap or observed SQL text variation. |
Severity does not predict that the application is broken.
The report sorts findings by severity, count, and stable rule ID, and shows up to ten sample details per rule. Dismissals keep their existing stable IDs, and retired IDs are never reassigned.
Filter the list, then jump to a check — the detail below narrows to match.
DB-SCHEMA-001MEDIUMTables without a primary keyDB-SCHEMA-002MEDIUMForeign-key access-path reviewDB-SCHEMA-003LOWExact duplicate index candidatesDB-SCHEMA-004MEDIUMForeign key column type mismatch with the referenced columnDB-SCHEMA-005LOWUnique index duplicating a proven primary-key backing indexDB-SCHEMA-006LOWPotential duplicate foreign-key definitionsDB-SCHEMA-007LOWNarrow auto-generated primary keyDB-SCHEMA-010LOWInvisible or ignored indexesDB-SCHEMA-011HIGHForeign key specifies SET NULL on a NOT NULL columnDB-PG-001HIGHInvalid PostgreSQL indexesDB-PG-002HIGHPostgreSQL sequence nearing exhaustionDB-PG-003MEDIUMPostgreSQL NOT VALID constraint never validatedDB-PG-004MEDIUMPostgreSQL table lacking usable replica identityDB-PG-005LOWPostgreSQL unlogged tablesDB-PG-006HIGHPostgreSQL partitioned table has no attached partitionsDB-MYSQL-001MEDIUMTables on a non-transactional storage engineDB-MYSQL-002MEDIUMTables/columns using the legacy utf8mb3 character setDB-MYSQL-003HIGHMySQL/MariaDB AUTO_INCREMENT nearing exhaustionDB-MYSQL-004LOWUnenforced MySQL check constraintsDB-ORACLE-001HIGHUnusable Oracle indexesDB-ORACLE-002HIGHDisabled or unvalidated Oracle constraintsDB-ORACLE-003HIGHOracle sequence or identity generator nearing exhaustionDB-ORACLE-004LOWOracle global indexes with orphaned partition entriesDB-HIB-002MEDIUMDeclared entity relation name not found in the observed schemaDB-HIB-003MEDIUMDeclared column nullability differs from observed metadataDB-HIB-004MEDIUMDeclared column length exceeds observed column sizeDB-HIB-005HIGHDeclared uniqueness has no observed enforcing keyDB-HIB-006MEDIUMDeclared column name not found in the observed relationDB-HIB-007MEDIUMDeclared association has no matching observed foreign keyDB-HIB-009MEDIUMIDENTITY identifier column without database-side generationDB-HIB-010MEDIUMDeclared numeric precision or scale exceeds the observed columnDB-HIB-011MEDIUMDeclared JPA `@Index` has no matching observed indexDB-HIB-012MEDIUMNon-nullable association join column allows `NULL` in the observed schemaDB-HIB-013HIGHEnum constant name exceeds observed character column lengthDB-HIB-014HIGHDeclared JPA sequence generator name not found in the observed schemaDB-RUNTIME-001LOWSQL text variations with predicate literalsDB-DRIVER-001MEDIUMPostgreSQL driver does not rewrite batched insertsDB-DRIVER-002MEDIUMMySQL Connector/J does not rewrite batched statementsDB-DRIVER-003MEDIUMMySQL Connector/J reports affected rows instead of found rowsDB-DRIVER-004LOWMySQL Connector/J prepared-statement cache is off or smallDB-DRIVER-005LOWPostgreSQL driver prepared-statement cache is disabledDB-DRIVER-006LOWPostgreSQL driver sets a savepoint before every queryDB-DRIVER-007LOWJDBC driver diagnostic setting is enabledDB-DRIVER-008LOWJDBC driver has no socket timeoutDB-DRIVER-009LOWPostgreSQL connections do not carry an application nameDB-DRIVER-010MEDIUMMySQL Connector/J `autoReconnect` is enabledDB-POOL-001MEDIUMConnection pool can keep a connection idle longer than the server allowsDB-POOL-002MEDIUMConnection pool is larger than the server's connection limitDB-POOL-003LOWConnection pool has no maximum connection lifetimeDB-POOL-005MEDIUMConnection pool has a disabled or excessive acquisition timeoutDB-SERVER-001LOWPostgreSQL does not end sessions that are idle in a transactionDB-SERVER-003MEDIUMPostgreSQL autovacuum is disabledDB-SERVER-004LOWPostgreSQL `pg_stat_statements` is not availableDB-SERVER-005LOWPostgreSQL does not measure I/O timeDB-SERVER-007LOWMySQL Performance Schema is disabledDB-SERVER-008MEDIUMMySQL/MariaDB strict transactional SQL mode is disabled
Schema
Generic checks consume JDBC metadata enriched by supported catalogs. System/temporary schemas, migration bookkeeping, extension-owned objects and inherited child partitions are excluded where identified.
DB-SCHEMA-001 - Tables without a primary key
MEDIUM. Reports an application table with no primary-key columns in readable, complete metadata. A declared PK is useful row-identity documentation, but neither an ORM nor every replication arrangement universally requires a database PK. Review whether a natural key, surrogate key or intentional keyless relation is appropriate; absence alone does not prove unsafe updates or duplicate data.
Framework-generated one-row identifier tables are excluded once their complete column inventory is read: Hibernate's sequence emulation (a single integer next_val column, which Hibernate 6/7 creates for GenerationType.AUTO/SEQUENCE on MySQL and never gives a key) and Spring Batch's MySQL *_SEQ tables (ID plus a unique UNIQUE_KEY). Their DDL belongs to the framework, so a PK recommendation is not actionable. See Hibernate SequenceStyleGenerator.
DB-SCHEMA-002 - Foreign-key access-path review
MEDIUM. Reviews physical FKs without a known ordinary leading index access path over the complete child column set. An equality lookup can use those leading columns in a different order; indexing just one column of a composite FK is not equivalent. Known trailing expressions must not erase a usable leading key.
For identified H2 2.x datasources, a bounded INFORMATION_SCHEMA.INDEXES read on the same scan connection can establish an ordinary MVStore secondary index (MVSecondaryIndex, with catalog type INDEX or UNIQUE INDEX). JDBC tableIndexOther and an absent filter alone are insufficient: H2 also reports spatial indexes that way. Hash, spatial, custom and unidentified implementations remain unknown when they could serve the FK. PRIMARY KEY implementations, including delegate indexes, remain outside this refinement. The read preserves any tighter session query timeout and restores the exact original milliseconds without changing H2's cached JDBC timeout getter. If a physical H2 connection cannot be verified for safe disposal, the refinement is skipped without changing session state. A timeout-restoration failure discards that physical connection and fails the datasource instead of publishing promoted evidence. This narrow access-method evidence does not establish full index-comparison semantics or FK enforcement; other required gaps still leave coverage incomplete.
Partial, value-prefix and specialized definitions may require evidence this check does not have, but only an index that keys a foreign-key column, an expression or nothing known can make one FK's result unknown: a GIN, partial or generic-JDBC index over unrelated columns cannot serve that lookup and does not hide a finding. Incomplete index inventories cannot prove absence. MySQL/MariaDB engines that require FK support normally create a suitable index automatically, so contradictory metadata warrants investigation rather than blind DDL. Review parent-key changes and actual query plans before adding an index; an unindexed FK is not universally invalid or slow. See PostgreSQL FK constraints, MySQL FK restrictions and Oracle concurrency.
DB-SCHEMA-003 - Exact duplicate index candidates
LOW. Reviews exact ordinary-index definition overlap only when the relevant semantics are known. A shorter leading prefix of a longer index is not sufficient evidence of redundancy. Included payload, key order/direction, expressions, predicates, access method, collation/operator class, state and constraint ownership can make superficially similar indexes different. Unknown definitions do not prove equality. Review dependencies, hints and measured usage; BootUI does not assert that dropping an index is safe. Generic JDBC and vendor catalogs lacking the complete comparison evidence can therefore leave this check unevaluated. PostgreSQL and fully observed ordinary InnoDB indexes on MySQL/MariaDB can establish comparison evidence; Oracle and generic JDBC do not yet support full comparison semantics. For MySQL/MariaDB, complete, consecutive information_schema.statistics key parts must agree with JDBC identity/keys and report uniqueness, full-value keys (SUB_PART IS NULL), direction (A/D), BTREE type and known visibility on a positively identified InnoDB table. Other storage engines' full comparison semantics are not modelled. Joined column metadata must positively identify non-generated columns. Functional/generated keys, prefix keys, unreadable ordering or visibility, and incomplete or contradictory groups are not promoted. An expression default (DEFAULT_GENERATED, such as a timestamp defaulting to CURRENT_TIMESTAMP) does not make the column a computed/generated key. The same physical columns supply their collation; key order and direction remain significant. MariaDB unique keys with two trailing temporal or unreadable column types stay unknown: older STATISTICS metadata cannot distinguish an ordinary unique key from WITHOUT OVERLAPS. An index whose comparison semantics are not modelled — a PostgreSQL hash or GIN index, for instance — is reported as unknown only when it could pair with another index on the same table: same key columns, and an access method that is equal, B-tree-like on both sides, or not reported. The unknown names that index rather than its table. A readable datasource can still produce a PARTIAL report when an applicable comparison is unknown. If some comparisons are known but others remain unknown, the rule stays SKIPPED unless it has a confirmed finding; confirmed findings remain VIOLATION with the missing coverage diagnosed separately.
DB-SCHEMA-004 - Foreign key column type mismatch with the referenced column
MEDIUM. Compares each child column with the column actually named by the FK, including alternate referenced keys. Reports a known representational-domain discrepancy, not merely unequal type names. Decimal containment considers both integral and fractional capacity; unknown scale is not zero. Fixed-width UUID pairs count as fully compared, as do identical declarations whose type name, JDBC type, size and decimal digits are all reported and equal. A size or scale the driver does not report is unknown, not equal, so other date/time, boolean or vendor-type pairs remain an unknown comparison rather than a guess. Review intended value domains and vendor compatibility before aligning definitions. JDBC type-family classification alone cannot establish coercion behavior or query-plan quality. MySQL itself requires the size and sign of integer and decimal FK pairs to match; see MySQL 8.4 FK constraints.
DB-SCHEMA-005 - Unique index duplicating a proven primary-key backing index
LOW. Reviews an additional exact unique-index definition only when the actual PK backing identity and relevant index semantics are established. The first unique index with matching columns is not assumed to be the backing index. Different included columns, access semantics or ownership prevent an equivalence conclusion. A unique index that is partial, expression- or prefix-keyed, partitioned, of a special type, reported invalid, or of a reported access method outside the ordinary set compared here (such as hash, GIN, bitmap or an Oracle reverse-key index) is excluded from the comparison rather than reported as unknown: it can never be an exact duplicate of a proven backing index. A unique index whose semantics really are unreadable is reported once per index, naming the datasource, table and index. Oracle may use a nonunique index to enforce a PK/unique constraint. MySQL/MariaDB use the same complete ordinary-key evidence as DB-SCHEMA-003 and the catalog's unique PRIMARY identity linked to the JDBC-reported primary-key constraint; matching columns alone do not establish it. Full Oracle/generic-JDBC definition comparison remains unsupported. Complete known key columns that cannot match the primary-key backing index do not create an unknown-overlap warning; known ordinal divergence rules out exact overlap even for a shorter observed key. A short matching prefix, empty/blank key parts, unread inventories or incomplete backing columns remain unknown. Known non-overlaps do not turn other unread comparisons into a passing rule. Review full definitions and dependencies, never drop a guessed constraint backing index.
DB-SCHEMA-006 - Potential duplicate foreign-key definitions
LOW. Reviews relationships with identical qualified parent identities and child-to-parent pairs, including known update/delete actions and deferrability. Reordering the same pairs does not change the relationship; swapping which parent column each child references does. Different actions or timing are not redundant. Unmodeled enforcement/match semantics require checking full constraint definitions, not unconditional removal.
DB-SCHEMA-007 - Narrow auto-generated primary key
LOW. Reviews positively identified generated single-column TINYINT/SMALLINT keys. Their finite representable domain may be intentional. Type capacity is not a lifetime row count, a count of committed inserts or an exhaustion forecast. Review the intended domain; vendor generator checks separately inspect an observed frontier. No automatic widening is recommended.
DB-SCHEMA-010 - Invisible or ignored indexes
LOW. Reports a MySQL 8.0+ invisible (information_schema.statistics.IS_VISIBLE = 'NO'), MariaDB 10.6+ ignored (IGNORED = 'YES') or Oracle invisible (ALL_INDEXES.VISIBILITY = 'INVISIBLE') index. The optimizer does not use it by default, yet every INSERT, UPDATE and DELETE still maintains it, and an invisible UNIQUE index still enforces uniqueness. Such a state is usually a staged "soft drop" or a trial: decide whether it is finished, then make the index visible again or drop it after reviewing constraints, hints and dependencies.
Unknown visibility is a coverage gap, never a finding. Constraint-backing indexes, unusable indexes (see DB-ORACLE-001) and Oracle automatic-indexing candidates (SYS_AI_ names, deliberately kept invisible in report-only mode) are excluded. Servers predating the feature (MySQL 5.7, MariaDB before 10.6) are not applicable. MySQL use_invisible_indexes and Oracle OPTIMIZER_USE_INVISIBLE_INDEXES let a session opt in; MariaDB ignored indexes cannot be re-enabled through hints. See MySQL invisible indexes, MariaDB ignored indexes and Oracle invisible indexes.
DB-SCHEMA-011 - Foreign key specifies SET NULL on a NOT NULL column
HIGH. Reports a foreign key declaring ON DELETE SET NULL or ON UPDATE SET NULL (importedKeySetNull) where every referencing child column is NOT NULL. Executing the referential action on a parent delete or key update is then guaranteed to fail the child table's NOT NULL constraint. Requiring all referencing columns of a composite foreign key to be NOT NULL avoids false positives on PostgreSQL 15+ column-subset ON DELETE SET NULL (col) constraints, where DatabaseMetaData.getImportedKeys() reports importedKeySetNull for all constraint columns even when only a nullable subset is nulled. On PostgreSQL, each parent action is checked separately using its observed native trigger activation: disabled child checks do not suppress an active parent action, while an inactive action does not contribute to the finding. Missing or unsupported action evidence remains unknown. Other dialects exclude foreign keys known to be disabled or unenforced. Either make the referencing column(s) nullable or change the referential action to RESTRICT, NO ACTION or CASCADE. See PostgreSQL foreign key constraints.
Dialect detection and catalog augmentation
The product/version/JDBC metadata distinguishes PostgreSQL, MySQL and MariaDB. Oracle-specific augmentation requires a genuine Oracle banner and Oracle 19c or later; unknown compatible products retain generic metadata support. Oracle schema-resolution failure must not silently widen the scan to all visible schemas. The confirmation read is separate from ordinary scoped ALL_* augmentation.
Queries gate features by the detected version: PostgreSQL sequence views from 10, INCLUDE key/payload distinction from 11, index-build progress from 12 and NULLS NOT DISTINCT/schema publications from 15; PostgreSQL 18 enforcement semantics are not assumed on older servers. MySQL visibility, functional keys (8.0.13+) and MariaDB ignored indexes (10.6+) have separate capabilities. A denied or unsupported catalog is not an empty successful one. Bounded detail rows must not replace a complete composite index with only its first catalog key parts.
Primary contracts: Java 17 DatabaseMetaData, PostgreSQL pg_index, MySQL STATISTICS, MariaDB STATISTICS, Oracle ALL_INDEXES.
PostgreSQL
DB-PG-001 - Invalid PostgreSQL indexes
HIGH. Reports known indisvalid/indisready/indislive problems, preserving transient-build and partition-parent exclusions where supported. Planner validity, write maintenance and uniqueness are different facts. An invalid UNIQUE index left by a failed concurrent build may continue rejecting duplicates; invalid does not mean no enforcement or a guaranteed complete uniqueness guarantee. Confirm build state and dependencies before choosing a version-supported repair. See CREATE INDEX CONCURRENTLY.
DB-PG-002 - PostgreSQL sequence nearing exhaustion
HIGH. Reviews the observed sequence frontier against direction-aware sequence bounds and a known owning-column domain. Positive and negative increments and nondefault ranges matter. pg_sequences.last_value may be null because of permissions, lack of use or standby state. A null value is treated as "never read" (0% consumed, no coverage gap) only when the role holds SELECT or USAGE on the sequence and it is not an unlogged sequence read on a standby; otherwise it is unknown consumption, not zero, and must not erase the sequence definition. A fresh development database with unused identity columns therefore scans complete. setval(seq, v, false) leaves the same never-read state, so a sequence positioned that way but not yet read is assessed as unused from its configured start until its first nextval.
The 80% threshold describes a bounded-range snapshot, not remaining time. Cached reservations are not committed identifiers. Cycling can still exceed a narrower owning column before wrapping. Review sequence and column bounds together; restarting after deleting/archiving rows is not established safe. See CREATE SEQUENCE and pg_sequences.
DB-PG-003 - PostgreSQL NOT VALID constraint never validated
MEDIUM. The retained ID reports a foreign-key, check or PostgreSQL 18+ NOT NULL constraint (pg_constraint.contype in ('f', 'c', 'n')) currently not validated; the historical heading is retained for existing links, not as a claim that it was never validated or that a migration was forgotten. NOT VALID normally checks new/updated rows while leaving existing rows unverified; declaration flags alone do not establish that native enforcement triggers are enabled. PostgreSQL 18 also distinguishes enforcement state and represents NOT NULL constraints in pg_constraint. Review the intended migration stage and version-supported validation; the snapshot does not prove bad rows or how long the state has existed. See ALTER TABLE and PostgreSQL 18 pg_constraint.
DB-PG-004 - PostgreSQL table lacking usable replica identity
MEDIUM. Reviews a table in an applicable publication that publishes UPDATE or DELETE, using expanded membership and partition-root semantics. INSERT-only publications are excluded. Default identity without a PK and explicit NOTHING require review; unknown selected-index state is not assumed usable. Relevant writes can fail without waiting for a subscriber to attach. Review publication actions and choose an appropriate PK, supported identity index or FULL identity. See publications and pg_publication_tables.
DB-PG-005 - PostgreSQL unlogged tables
LOW. Reports an ordinary table or leaf partition with pg_class.relpersistence = 'u', excluding system and extension-owned tables. Unlogged tables skip write-ahead logging: PostgreSQL truncates them after a crash or immediate shutdown, does not replicate them to physical standbys (where they cannot be read), and cannot restore their contents by WAL-based point-in-time recovery. A logical pg_dump still copies their rows. Unlogged storage is an explicit DDL choice, often deliberate for caches or staging data, so this is a durability review prompt; ALTER TABLE ... SET LOGGED rewrites and WAL-logs a table that must be durable. Partitioned parents are not read: PostgreSQL 13-18 rejects unlogged partitioned tables, so their persistence flag carries no storage meaning. A denied or failed catalog read is SKIPPED, not clean. See CREATE TABLE UNLOGGED.
DB-PG-006 - PostgreSQL partitioned table has no attached partitions
HIGH. Reports a declaratively partitioned parent table (pg_class.relkind = 'p') that has zero attached child partitions in pg_inherits, excluding system and extension-owned tables. Because a partitioned parent table holds no storage of its own, every INSERT into it fails immediately at runtime with no partition of relation "..." found for row until at least one partition (or a DEFAULT partition) is created or attached. See PostgreSQL table partitioning.
MySQL and MariaDB
DB-MYSQL-001 - Tables on a non-transactional storage engine
MEDIUM. Reviews known nontransactional engines while preserving intentional specialist exclusions. Rollback support, FK enforcement, crash safety and locking are different capabilities: MariaDB Aria can be crash-safe without being transactional. Review application transaction requirements and migration costs, not merely whether the engine is named InnoDB. See MariaDB Aria.
DB-MYSQL-002 - Tables/columns using the legacy utf8mb3 character set
MEDIUM. Reviews observed utf8/utf8mb3 defaults or column encodings, not every non-utf8mb4 choice. Three-byte encoding cannot represent the full Unicode range. Changing a table default is distinct from converting existing columns. Review supported character sets, index lengths and required comparison semantics before migration; a different collation can change uniqueness and ordering.
MariaDB 11.4.5+ supports MySQL-compatible 0900 names as aliases to UCA1400 collations. This does not mean older MariaDB supports them or that the implementation is identical to MySQL's. See MariaDB 11.4.5.
DB-MYSQL-003 - MySQL/MariaDB AUTO_INCREMENT nearing exhaustion
HIGH. Reviews a reported next/reserved counter at or beyond the 80% threshold of the known signed/unsigned column capacity. Arithmetic accommodates BIGINT UNSIGNED; missing counter or column evidence is unknown, not zero or a clean pass.
InnoDB counter metadata can be cached/reserved/stale and is not a committed-row count. MariaDB has persistent InnoDB counters from 10.2.4, not only an in-memory counter on modern versions. Persistence does not make allocation transactional or gapless. Review column bounds and referencing columns without querying application MAX(id) or resetting counters. See MariaDB InnoDB counter handling.
DB-MYSQL-004 - Unenforced MySQL check constraints
LOW. Reports a MySQL 8.0.16+ CHECK constraint on a base table whose information_schema.table_constraints.ENFORCED column is 'NO', completing cross-dialect constraint-state coverage alongside DB-PG-003 and DB-ORACLE-002. An unenforced check constraint remains in DDL metadata but validates neither new writes nor existing rows. MariaDB and MySQL versions before 8.0.16 do not support NOT ENFORCED check constraints and are SKIPPED as not applicable. See MySQL CHECK constraints.
Oracle
Augmentation uses scoped ALL_* dictionary reads with bound owner parameters on confirmed Oracle 19c+, without a production Oracle-driver dependency. Exact owner/object identity and independent partition metadata are necessary; an inaccessible partition catalog does not establish that all partitions are usable.
DB-ORACLE-001 - Unusable Oracle indexes
HIGH. Reports explicit UNUSABLE ordinary/partition/subpartition state. Null, unknown and N/A are not synonyms for UNUSABLE. Domain-index special semantics are excluded consistently. GENERATED='Y' describes an index's generated name, not constraint ownership. An unusable unique enforcement index can block DML even with SKIP_UNUSABLE_INDEXES enabled. Review exact index/partition type and dependencies before a suitable maintenance operation. See ALL_INDEXES.
DB-ORACLE-002 - Disabled or unvalidated Oracle constraints
HIGH. Interprets known STATUS and VALIDATED together, with enforcement, RELY and deferral kept distinct. ENABLE NOVALIDATE checks new changes without proving old rows valid; DISABLE VALIDATE has different restrictions from DISABLE NOVALIDATE. An automatically named NOT NULL check is not excluded when its actual state is problematic. Unknown strings do not establish a disabled constraint. Review the intended state and Oracle's ENABLE VALIDATE CONSTRAINT syntax and locking implications. See ALL_CONSTRAINTS and data integrity.
DB-ORACLE-003 - Oracle sequence or identity generator nearing exhaustion
HIGH. Reviews positive/negative sequence bounds and known linked identity-column precision. NUMBER(p,0) can be much narrower than the underlying sequence; not every identifier is an unconstrained NUMBER. Identity ownership is obtained from dictionary linkage, not guessed from an ISEQ name.
LAST_NUMBER includes cache reservation, not committed consumption. The 80% snapshot threshold is not a time estimate. Session/scalable/sharded definitions remain excluded from ordinary range inference, and cycling does not automatically protect a narrower column. Oracle does not expose the original starting value through ALL_SEQUENCES: the denominator is the configured directional min/max range, with both endpoints clamped to a known identity-column domain. Use identity-aware column guidance for internal identity sequences; do not blindly alter/reset their sequence. Review bounds and precision without querying application rows. See ALL_SEQUENCES, ALL_TAB_IDENTITY_COLS and NUMBER types.
DB-ORACLE-004 - Oracle global indexes with orphaned partition entries
LOW. Reports an Oracle global index with ALL_INDEXES.ORPHANED_ENTRIES = 'YES', excluding domain indexes and indexes already reported UNUSABLE by DB-ORACLE-001. When a partition is dropped or truncated with UPDATE INDEXES, Oracle keeps global indexes VALID and marks ORPHANED_ENTRIES = 'YES' for asynchronous cleanup by PMO_DEFERRED_GIDX_MAINT_JOB / DBMS_PART.CLEANUP_GIDX. If deferred maintenance does not run, index scans continue filtering stale entries from dropped partitions. See ALL_INDEXES.
Hibernate mapping
These checks compare available declarations with observed metadata, not Hibernate's effective runtime mapping. Even explicit annotation/XML names are logical names subject to a physical naming strategy. The pinned Spring Boot 4.1.1 BOM selects Hibernate 7.4.5.Final; Quarkus 3.40.1.2 selects 7.4.9.Final; both use Persistence 3.2.0. The matching 7.4 contract explicitly distinguishes logical names from names used in generated DML/DDL.
No persistence-unit-to-datasource or effective optimizer contract is guessed: in multi-datasource applications, entities are evaluated against a datasource only when their persistence unit is unambiguously attributed to that datasource's connection pool. Failed or ambiguous source inventories, unresolved inheritance/overrides, incomplete columns and unsupported association placement cannot prove missing schema objects. Relation-name resolution must not confuse a mapped view with a missing base table. Ordinary reflection also cannot distinguish an omitted annotation default from that same default written explicitly. The bridge recognizes annotation-visible converters and placement restrictions, but does not resolve auto-applied converters, XML overrides or provider-specific effective JDBC mappings.
DB-HIB-002 - Declared entity relation name not found in the observed schema
MEDIUM. Reviews an explicit declared table name not observed in sufficiently complete scoped relation metadata. This is not proof that the effective Hibernate table is missing. Review naming strategy, relation type, privileges, migration and persistence-unit/datasource assignment before changing anything.
DB-HIB-003 - Declared column nullability differs from observed metadata
MEDIUM. Compares a declared @Column(nullable=false) against known physical nullability. Java type families are not JDBC mapping evidence, so this rule does not compare column types. Relations reported by JDBC as VIEW or MATERIALIZED VIEW, including secondary views, are excluded: a view's reported nullable column does not establish a missing physical NOT NULL constraint. Views remain available for relation-name and column-name checks. When only view columns would be compared, this rule is SKIPPED with an informational diagnostic, not a finding or a passing check; ordinary table mismatches in the same scan are still reported. Entity annotations such as @Immutable do not exempt a physical table from the comparison. Default-valued true does not establish explicit intent. Raw Java type family no longer proves an effective JDBC type mismatch: converters, Boolean/UUID emulation and custom types are valid. Review declarations and actual column constraints, not a guessed Java-to-SQL representation.
DB-HIB-004 - Declared column length exceeds observed column size
MEDIUM. Compares positive nondefault declared lengths with a positively bounded physical string column. LOB, conversion, native-definition and unresolved placement ambiguity are excluded. An explicit @Enumerated(EnumType.STRING) enum without an @EnumeratedValue field stores the constant's name(), so it is compared like a string. Implicit or ORDINAL enums, and other ambiguous mappings, are silently skipped on non-character columns and reported as unknown evidence only when the physical column is bounded character storage. Native MySQL/MariaDB ENUM and SET columns, which drivers report as character types sized to the longest label, are not compared. An arbitrary large length is not synonymous with an unbounded SQL type. @Column(length=...) describes schema generation, not runtime input validation; review declaration versus database definition rather than assuming the mapping accepts or validates every string of that length.
DB-HIB-005 - Declared uniqueness has no observed enforcing key
HIGH. Reviews declared uniqueness against known physical guarantees, separately from optimizer visibility. Invisible/ignored UNIQUE indexes still enforce uniqueness. A value-prefix key may reject more values without permitting duplicate full keys. Subset coverage also depends on null semantics: Oracle UNIQUE(a) with nullable a can allow repeated (NULL, 1) rows that UNIQUE(a, b) rejects. Such Oracle subset coverage needs known NOT NULL keys or equivalent evidence; it cannot be assumed. INCLUDE payload is not a unique key. Oracle may use nonunique backing indexes for unique constraints, so a nonunique constraint-backed index (including a PostgreSQL exclusion constraint) keeps the result unknown; a unique constraint-backed index such as a primary key is judged on its own structure. Collation cannot weaken enforcement (deterministic collations compare bytes, nondeterministic ones only merge more values), but a PostgreSQL key part with a non-default operator class may redefine equality and needs review. Partial, invalid, operator-class and unknown definitions require precise evidence, but only when the index could cover the declared columns; an uncertain index on other columns does not hide a missing key. Review full constraint semantics before adding a new guarantee.
DB-HIB-006 - Declared column name not found in the observed relation
MEDIUM. Reviews an explicit declared column name not observed in a resolved relation with complete column metadata. Physical naming, inherited/secondary placement and source ambiguity must be considered. Do not infer inevitable runtime SQL failure or prescribe applying a migration solely from annotation names.
DB-HIB-007 - Declared association has no matching observed foreign key
MEDIUM. Reviews a complete explicit association declaration against actual qualified child-to-parent pairs. Respects NO_CONSTRAINT, supported join placement and explicit target information. A single join column that omits referencedColumnName is paired with the JPA default, the target entity's @Id column, once that column is corroborated as the target table's observed single-column primary key. The @Id column is taken from an explicit @Column(name), or from a plain lowercase attribute name such as id. Composite joins with an omitted referenced column, an unestablished or non-primary-key identifier, and constraints that pair the join column with a non-primary-key target column remain unknown. A matching constraint passes only when it is known to be enforced. On PostgreSQL, a separate bounded catalog read checks the declaration and all four native referential-integrity triggers on ordinary, non-inherited relations, including the child insert/update and parent delete/update roles. Disabled triggers prevent a healthy match even when the declaration remains validated. Trigger modes are interpreted for the scan connection's session_replication_role, not every application session or future write. Missing, ambiguous, unsupported or unreadable evidence stays unknown; an absent row never proves enforcement. NOT VALID is independent of trigger enforcement and does not establish historical row integrity; DB-PG-003 retains that declaration-validation scope. JPA cascade does not imply database ON DELETE CASCADE; FK-generation annotations are not a proof of the live database's intended cascade policy. Review whether a database constraint is intended before adding one. See Jakarta Persistence 3.2.
DB-HIB-009 - IDENTITY identifier column without database-side generation
MEDIUM. Reviews an explicitly named @Id declaring @GeneratedValue(strategy = GenerationType.IDENTITY) whose resolved PostgreSQL, MySQL or MariaDB column the driver explicitly reports with IS_AUTOINCREMENT = NO, no COLUMN_DEF default and no generated column. Hibernate omits an IDENTITY key from the INSERT and reads back the database-generated value, so such inserts fail, or store a placeholder on a nullable column or in non-strict MySQL modes, unless something the metadata cannot show, such as a BEFORE INSERT trigger, assigns the key. Hibernate schema validation does not compare this.
pgjdbc reports IS_AUTOINCREMENT = YES for identity columns and nextval(...) defaults, and the MySQL/MariaDB drivers report AUTO_INCREMENT. A missing or empty value is unknown, never NO. Other drivers' semantics are not established, so other dialects are not compared. GenerationType.AUTO and an omitted strategy are provider-selected and are not treated as IDENTITY; the identifier column must be explicitly named because physical naming strategies differ between Spring Boot and Quarkus. Check for a trigger first, then make the column database-generated or change the strategy. This is a physical cross-reference, not the Hibernate advisor's HIB-ID-001/HIB-ID-006 trade-offs.
DB-HIB-010 - Declared numeric precision or scale exceeds the observed column
MEDIUM. Compares a positive @Column(precision = p, scale = s) on a BigDecimal/BigInteger attribute with a bounded physical DECIMAL/NUMERIC column. With a positive precision, Hibernate 7.2/7.4 applies the annotation's scale as written, including its default zero, so both are compared. A narrower physical scale silently rounds written values; fewer physical integer digits (precision minus scale) reject large values, or clamp them in non-strict MySQL/MariaDB modes. Converters, native column definitions, @Lob and non-decimal attributes are not compared. Unconstrained columns (PostgreSQL numeric without a type modifier, Oracle NUMBER without precision), negative scales and a scale larger than the precision are unknown rather than guessed. This complements the Hibernate advisor's HIB-MAP-014, which reports a missing declaration. @Column(precision/scale) is schema-generation metadata, not input validation. See PostgreSQL numeric types and MySQL 8.4 fixed-point types.
DB-HIB-011 - Declared JPA @Index has no matching observed index
MEDIUM. Cross-references explicit @Table(indexes = @Index(...)) and @SecondaryTable(indexes = @Index(...)) declarations against observed base-table indexes leading on the declared column list and explicit ASC/DESC direction. Hibernate's SchemaValidator (ddl-auto=validate) ignores @Index annotations, so a missing migration leaves the table unindexed without failing startup validation. Unique @Index(unique = true) declarations already covered by @UniqueConstraint or @Column(unique = true) are left to DB-HIB-005. See Jakarta Persistence 3.2.
DB-HIB-012 - Non-nullable association join column allows NULL in the observed schema
MEDIUM. Compares explicit @JoinColumn(name = "...", nullable = false) and owning @ManyToOne/@OneToOne(optional = false) declarations on non-inheritance base tables with observed physical column nullability. When an association is declared non-optional, Hibernate can emit an INNER JOIN that silently drops rows whose foreign-key column is NULL. Views, materialized views and inheritance hierarchies (where SINGLE_TABLE subclass columns must be nullable) are excluded. See Jakarta Persistence 3.2.
DB-HIB-013 - Enum constant name exceeds observed character column length
HIGH. Compares the longest constant .name().length() of an explicit @Enumerated(EnumType.STRING) attribute (without @EnumeratedValue, @Convert or a native column definition) against a bounded physical VARCHAR(n) or CHAR(n) column size, even when @Column(length) was left at its 255 default. An enum constant longer than the physical column is guaranteed to fail or truncate when persisted. Unbounded text columns and MySQL/MariaDB native ENUM/SET columns are excluded. See Jakarta Persistence 3.2.
DB-HIB-014 - Declared JPA sequence generator name not found in the observed schema
HIGH. Cross-references explicit @SequenceGenerator(sequenceName = ...) declarations on @Id@GeneratedValue(strategy = GenerationType.SEQUENCE) attributes targeting the connected schema against a complete observed PostgreSQL or Oracle sequence inventory, honoring identifier case folding. See Jakarta Persistence 3.2.
Runtime SQL
DB-RUNTIME-001 - SQL text variations with predicate literals
LOW. Describes distinct retained SQL texts sharing a normalized shape that contains predicate literals, within a bounded SQL Trace observation window. It issues no new query and reports bounded counts and an opaque shape identifier, not captured literal values or allegedly guaranteed literal-free SQL text. Executions that differ only in SQL comments, unquoted whitespace, or the number of bound IN (?, ?) placeholders count as one text. Pass the shape id as the get_sql_traces query to list its statements.
Changed projection constants or legitimate framework discriminator literals can produce variation. This does not establish that predicate values changed, that code concatenated input, that a plan cache is inefficient or that an injection vulnerability exists. A larger variant count is not “high confidence” in any of those claims. Inspect the existing SQL Trace evidence and call site before deciding whether parameterization is relevant. An absent capture window is SKIPPED.
JDBC driver
These rules judge driver settings, not the schema, and need two kinds of evidence beyond the scan connection:
- Configured settings. The scan connection's
DatabaseMetaData.getURL()is parsed for a short allow-list of non-secret driver settings, and the datasource's pool supplies its driver properties (HikariCPdataSourceProperties, Agroal additional JDBC properties). Every other name,userandpasswordincluded, is discarded unread. The URL, user name and password are never stored, logged or returned, and the findings are labelled configured: they say what the URL and the pool configure, not what the driver ends up using. - Effective JDBC batching. The Hibernate advisor's observed
hibernate.jdbc.batch_sizeof the persistence unit attributed to the datasource's pool (seeHIB-CONFIG-004). Only HikariCP and Agroal pools are attributed; without an attributed persistence unit, the batching checks skip that datasource without affecting coverage of the others. Several persistence units on one pool count as batching when any of them batches. A datasource is reported as not batching only when every unit on it is known not to batch and no unit could be hiding elsewhere. If a unit is attributed but effective batching cannot be determined, the datasource is unassessed. In a mixed inventory this is a coverage gap: a prior finding on that datasource remains unverified, but a fully assessed datasource can still confirm a fix or report a finding, even for a long datasource name. If distinct datasources share a name and the driver check applies to one of them, batching evidence cannot be attributed under that name. Name collisions between unrelated drivers do not affect the check.
On an individual datasource, a rule skips evaluation with a reason when: the driver is not the one the rule verifies (MariaDB Connector/J is not evaluated: it has a different bulk setting); for the batching rules, batching is off or unknown; the JDBC URL or the pool's driver properties could not be read and could change the answer; the URL and the pool disagree and the driver defines no winner; a service (pgjdbc) or useConfigs (Connector/J) setting makes the driver read more configuration from a file the advisor does not see, so an absent setting proves nothing; a Connector/J propertiesTransform can replace any explicit value, so nothing is judged; the setting is given as a Connector/J host-level property (address=(host=h)(useAffectedRows=true) or (host=h,useAffectedRows=true)); or a name is spelled other than exactly (both drivers read exact, undecoded names, so rewritebatchedinserts or reWriteBatched%49nserts is not the setting).
The pool's driver properties are read only for URL-configured HikariCP and Agroal pools. A HikariCP pool built on a DataSource object or class (dataSource, dataSourceClassName) keeps its driver settings on that object, and an Agroal datasource that Quarkus has not created yet cannot be read: both are reported as "could not be read", not as "no settings".
| Driver | URL and pool both set the same property | Boolean values | Integer values |
|---|---|---|---|
| pgjdbc | The URL wins ("the value from Properties object is ignored"); a pool value is trusted only when the URL was read | Boolean.parseBoolean: only true (any case) is true, no trimming | Integer.parseInt: no trimming, no fraction; anything else is SKIPPED |
| MySQL Connector/J | No precedence is relied on: differing values are SKIPPED as unsettled, and a value from one source is not trusted while the other could not be read. (Connector/J 9.7 lets a Properties value override the URL; older lines were not checked.) | true, false, yes, no (any case); anything else is SKIPPED | Parsed as a double and truncated (2048.0 and 2e3 are valid); a value below the property's minimum (prepStmtCacheSize 0, prepStmtCacheSqlLimit 1, socketTimeout 0), which the driver refuses, or anything else is SKIPPED |
Driver rules use the JDBC driver category: DB-DRIVER-001 to 003 and 010 are MEDIUM, DB-DRIVER-004 to 009 are LOW. Verified against pgjdbc 42.7.13 and MySQL Connector/J 9.7.0, the versions the sample applications resolve (Spring Boot 4.1 and Quarkus 3.40): names and defaults come from the drivers' own PGProperty and PropertyDefinitions sources, as does the precedence above; the vendor documentation is cited in each rule. A finding names the setting, where it was configured and the observed value, and is labelled configured. Findings are keyed by datasource and setting, never by value, so a changed value keeps the same identity. When a rule judges several settings, a finding on one never hides another that could not be judged: that one is reported as a coverage gap of the scan.
DB-DRIVER-001 - PostgreSQL driver does not rewrite batched inserts
MEDIUM. Applies to a PostgreSQL datasource using the PostgreSQL JDBC driver (pgjdbc, driver name exactly PostgreSQL JDBC Driver; other drivers are skipped). Fires when Hibernate JDBC batching is enabled for the datasource and reWriteBatchedInserts (default false) is not true in the URL or the pool's driver properties. Without it each batched insert still travels as its own one-row statement; pgjdbc documents that enabling it turns them into multi-row inserts, "2-3x performance improvement". It concerns INSERT only, and Hibernate cannot batch inserts of IDENTITY entities (see HIB-ID-006). Measure before and after. See pgjdbc connection parameters.
DB-DRIVER-002 - MySQL Connector/J does not rewrite batched statements
MEDIUM. Applies to datasources using MySQL Connector/J (driver name contains MySQL Connector), including a MariaDB server reached through it. Fires when batching is enabled and rewriteBatchedStatements (default false) is not true (yes is accepted). Connector/J then does not rewrite a batch of prepared INSERT/REPLACE statements into multi-values statements. The recommendation carries the vendor warnings: enabling it turns on multi-queries, which "might allow SQL injection when using plain statements and the provided input is not properly sanitized" (Hibernate uses prepared statements); Statement.getGeneratedKeys() of a rewritten batch works only when the whole batch is INSERT/REPLACE; and rewritten INSERT ... ON DUPLICATE KEY UPDATE batches report different update counts. Read those notes before enabling it. See Connector/J performance extension properties.
DB-DRIVER-003 - MySQL Connector/J reports affected rows instead of found rows
MEDIUM (correctness). Applies to MySQL Connector/J. Fires when useAffectedRows is true in the URL or the pool's driver properties. Connector/J documents that it does not set CLIENT_FOUND_ROWS, which "is not JDBC-compliant and it will break most applications that rely on 'found' rows vs. 'affected rows' for DML statements". An UPDATE that writes the values a row already holds then reports 0 rows, which an ORM can read as a lost update (an optimistic-lock or stale-state failure). It needs no batching evidence. The effect on batched updates is not claimed here. See Connector/J connection properties.
DB-DRIVER-004 - MySQL Connector/J prepared-statement cache is off or small
LOW. Applies to datasources using MySQL Connector/J. One finding per datasource, listing the sub-conditions that fired: cachePrepStmts (default false) is not true; or it is true and prepStmtCacheSqlLimit (default 256) is below 2048; or it is true and prepStmtCacheSize (default 25) is below 250. The thresholds are the values the HikariCP MySQL Configuration page recommends (size 250-500, limit 2048, noting that the driver default limit "is well below the threshold of generated statement lengths" with an ORM such as Hibernate) and are named constants of the rule, echoed in each finding. The page also states that the size and the limit "have no effect if the cache is in fact disabled", which is why they are judged only once the cache is on. The cache is held per connection, so a larger size costs memory on every pooled connection. Measure before and after. See HikariCP MySQL configuration.
DB-DRIVER-005 - PostgreSQL driver prepared-statement cache is disabled
LOW. Applies to pgjdbc. One finding per setting that disables the per-connection prepared-statement cache: preferQueryMode is exactly simple (no parse, no bind; pgjdbc compares the text exactly and documents the mode as "for debugging purposes only"), preparedStatementCacheQueries (default 256) is 0 or below, or preparedStatementCacheSizeMiB (default 5) is 0 or below (pgjdbc clamps a negative value to 0, so it disables the cache just as 0 does). Each statement is then parsed again. Remove the setting unless it is deliberate. See pgjdbc connection parameters.
DB-DRIVER-006 - PostgreSQL driver sets a savepoint before every query
LOW. Applies to pgjdbc. Fires when autosave (default never) is always, read case-insensitively like the driver does; a value that is not never, conservative or always is SKIPPED, because the driver would refuse it. In that mode the driver sets a savepoint before each query and rolls back to it on failure, which adds work to every statement of a transaction. Keep it only when the application continues a transaction after a failed statement; conservative sets the savepoint but rolls back only in rare cases. See pgjdbc connection parameters.
DB-DRIVER-007 - JDBC driver diagnostic setting is enabled
LOW. Applies to MySQL Connector/J and pgjdbc. One finding per setting that is on. Connector/J: profileSQL, logSlowQueries, gatherPerfMetrics, useUsageAdvisor, traceProtocol, enablePacketDebug, autoGenerateTestcaseScript and explainSlowQueries, all of which default to false and add overhead while on. pgjdbc: logUnclosedConnections (default false), which captures a stack trace at each connection opening. Turn them off once the investigation they were enabled for is over. See Connector/J debugging and profiling properties.
DB-DRIVER-008 - JDBC driver has no socket timeout
LOW. Applies to MySQL Connector/J and pgjdbc. Fires when the driver property socketTimeout is absent or 0 (the default of both drivers, meaning no timeout) in the URL and the pool's driver properties, so a thread can wait indefinitely on a connection that was silently dropped. The unit differs and is normalised before comparing: pgjdbc counts seconds, Connector/J milliseconds; a pgjdbc value of 0 or below is no timeout (the driver applies only positive values), and a value a driver would refuse (a fraction for pgjdbc, a negative number for Connector/J) is SKIPPED. The rule judges only the configured driver property and deliberately never calls Connection#getNetworkTimeout(): that is mutable per-connection state (a pool may set and reset it) and says nothing about the property. A timeout supplied through another driver mechanism is not visible, so the text says it is not configured in the URL or pool properties, and the severity stays LOW. See pgjdbc connection parameters.
DB-DRIVER-009 - PostgreSQL connections do not carry an application name
LOW. Applies to pgjdbc only; another PostgreSQL driver is SKIPPED. Fires when ApplicationName is not configured in the URL or the pool's driver properties, is blank, or equals the driver default PostgreSQL JDBC Driver, so the connection shows that default name in pg_stat_activity, which BootUI's own PostgreSQL panel reads. No query is run and the configured name is never echoed. Set it in the JDBC URL or in the pool's data-source properties (for HikariCP, spring.datasource.hikari.data-source-properties.ApplicationName); no mapping from spring.application.name to pgjdbc is established, so none is recommended. See pgjdbc connection parameters.
DB-DRIVER-010 - MySQL Connector/J autoReconnect is enabled
MEDIUM. Applies to MySQL Connector/J. Fires when autoReconnect or autoReconnectForPools (both default false) is true in the JDBC URL or the pool's driver properties. Connector/J documents that "the use of this feature is not recommended, because it has side effects related to session state and data consistency" and can corrupt in-flight transactions while hiding dead connections from HikariCP or Agroal. Let the connection pool manage connection validation and replacement instead. See Connector/J high availability properties.
Connection pool
A pool and the database server each enforce limits, and the two have to agree: a session the server closed while the pool still held it, a pool larger than the server can serve, a connection that is never retired. These rules compare the pool's numbers with the server's, and use the Connection pool category.
Two kinds of evidence, both labelled effective (read from the live object or connection, not from configuration):
- The pool. The sanitized numbers of the HikariCP or Agroal pool attributed to the datasource (maximum size,
minimumIdle,idleTimeout,maxLifetime,keepaliveTime), read without borrowing a connection and without the JDBC URL, user name or bean name. They are read after the schema, because the scan connection is what starts a pool that initializes lazily, and HikariCP validates and may replace its configured values when it starts (amaxLifetimeunder 30 seconds becomes the default, akeepaliveTimenot shorter thanmaxLifetimeis dropped). Pools are matched to a datasource by exact name; a datasource whose pool cannot be attributed, or that uses another pool library, is not judged: the rule isSKIPPEDwith that reason, and when another datasource is assessed the omission is reported as a coverage gap, so a clean result never hides it and an earlier finding on it is not shown as resolved. - The server. A small allow-listed read in the same bounded scan as the other catalog reads (query timeout, row bound, scan budget, failure reported as a diagnostic, never a connection borrowed for the pool half): PostgreSQL
select name, setting, unit from pg_settings where name in (...)(bound names the pool rules use:max_connections,superuser_reserved_connections,reserved_connections,idle_session_timeout) and MySQL/MariaDBshow session variables where Variable_name in (...)(wait_timeout,max_connections), which, unlike aUNION, tolerates a name the server does not know. The same statements also carry the settings the Server rules judge, so one read serves both groups. The values are those of the scan connection's own session: a pool init statement or driver option can give pooled sessions another value. A setting the server did not report, one this version lacks (idle_session_timeoutbefore PostgreSQL 14 is "not supported by this server version",reserved_connectionsbefore 16 is simply0), or a value that does not parse is unknown, never zero.
The rules judge PostgreSQL, MySQL and MariaDB datasources, one pool at a time: several pools to the same server are not added together. A proxy that multiplexes connections (PgBouncer, RDS Proxy, ProxySQL) is not visible from the application, and changes the meaning of both server limits; dismiss the rule when one sits in the path.
| Rule | Severity | Fires when |
|---|---|---|
DB-POOL-001 | MEDIUM | the pool can hold an idle connection longer than the server allows |
DB-POOL-002 | MEDIUM | the pool's maximum size exceeds the connections the server lets an ordinary role hold |
DB-POOL-003 | LOW | maxLifetime is 0 (no limit) and DB-POOL-001 does not report the datasource |
DB-POOL-005 | MEDIUM | the pool's connection acquisition timeout is disabled (0 on Agroal, Integer.MAX_VALUE on HikariCP) or exceeds 5 minutes |
DB-POOL-001 - Connection pool can keep a connection idle longer than the server allows
MEDIUM. HikariCP only. Let S be the server's idle-session limit: MySQL/MariaDB wait_timeout (seconds), or PostgreSQL idle_session_timeout when above 0 (0 means disabled, so there is nothing to compare). The rule fires when all three hold:
maxLifetime == 0ormaxLifetime >= S: the connection is not retired by age before the server closes it;keepaliveTime == 0orkeepaliveTime >= S: nothing pings it before then;- idle retirement does not cover it: not (
minimumIdle == 0andidleTimeout > 0andidleTimeout + 30 s < S). HikariCP retires idle connections on a housekeeping timer, up to 30 seconds afteridleTimeout, so the configured value alone is not proof; withminimumIdleabove0the idle connections are never retired, and an unreadableminimumIdle(HikariCP's unset value, before the pool has started) is unknown.
Each condition is three-valued: a defence that is known to cover settles the answer whatever the others are, and one that cannot be read can neither cause nor hide a finding. The message states the three pool values and S, and that the pool may hand out a connection the server has already closed. It does not say whether the application sees an error or only pays reconnection latency: HikariCP validates a connection that was idle for more than 500 ms before handing it out, and PoolSettings carries no validation evidence. Stock settings do not fire it: the HikariCP defaults (maxLifetime 30 min, keepaliveTime 2 min since 6.2.1) cover MySQL's default wait_timeout of 8 hours, and PostgreSQL's idle_session_timeout defaults to 0.
SKIPPED for Agroal, which exposes neither a keepalive nor a validation setting, so the judgement would miss half of its inputs. See HikariCP configuration, MySQL wait_timeout and PostgreSQL idle_session_timeout, which warns to "be wary of enforcing this timeout on connections made through connection-pooling software".
DB-POOL-002 - Connection pool is larger than the server's connection limit
MEDIUM. Fires when maximumPoolSize is greater than the usable connections: max_connections on MySQL/MariaDB, max_connections - superuser_reserved_connections - reserved_connections on PostgreSQL. The pool can never fill, and other clients of the server count against the same limit. This is the budget of an ordinary role: a role granted pg_use_reserved_connections, or a superuser, may use the reserved slots. Evaluates for Agroal too. An unreadable pool size, or a server limit that is missing, truncated or does not parse, is SKIPPED for that datasource.
DB-POOL-003 - Connection pool has no maximum connection lifetime
LOW. Fires when maxLifetime is 0 and DB-POOL-001 does not report the same datasource. HikariCP recommends a lifetime several seconds shorter than any limit the database or the infrastructure in between imposes, which BootUI cannot see. It needs no server evidence and still runs when the server could not be read, with one exception: when whether DB-POOL-001 owns a HikariCP datasource is unsettled (the server limit, or a pool setting that decides it, could not be read) the rule is SKIPPED rather than guess, so that the next scan cannot present a replaced finding as resolved. On Agroal 0 is the default unless quarkus.datasource.jdbc.max-lifetime is set, and Agroal's background validation is not observable here, so the finding is a review prompt there.
Ownership. DB-POOL-001 owns a datasource whenever it fires, because its finding already includes the unlimited maxLifetime; DB-POOL-003 stays quiet, so one problem is never counted twice. Both use the same pure function, so the ownership cannot drift.
DB-POOL-004 - Connection pool leaves no headroom for a second instance
Retired. Assumes a multi-instance deployment against a single database without a connection proxy, cites an inaccurate Quarkus default (50, whereas quarkus.datasource.jdbc.max-size defaults to 20), and shares the exact same finding identity (ds=<datasource>|pool=maximum-size) as DB-POOL-002. DB-POOL-002 remains the check for a pool whose maximum size exceeds the server's usable connections.
DB-POOL-005 - Connection pool has a disabled or excessive acquisition timeout
MEDIUM. Fires when the attributed HikariCP or Agroal pool's connection acquisition timeout (PoolSettings.connectionTimeoutMs()) is disabled (0 on Agroal, or Integer.MAX_VALUE ms when HikariCP converts connectionTimeout=0) or exceeds 5 minutes (300,000 ms). Callers waiting on an exhausted pool or an unreachable database then block for minutes or indefinitely instead of failing fast. Stock HikariCP (30 s) and Quarkus Agroal (5 s) defaults pass. See HikariCP configuration.
Server
These rules read a few settings of the database server itself and flag the values that remove a safety net or the data the PostgreSQL and MySQL panels need. The panels show the same numbers without a verdict; the advisor is where a verdict belongs, because it is scored and each rule can be dismissed. They use the Server category and the LOW or MEDIUM level of the severity scale.
Evidence is labelled effective, as seen by the scan connection: the values come from the same bounded scan as the other catalog reads (query timeout, row bound, scan budget, a failure is a diagnostic and never a borrowed second connection), through the allow-listed read the connection-pool rules already use: PostgreSQL select name, setting, unit from pg_settings where name in (...) with bound names, and the fixed MySQL/MariaDB show session variables where Variable_name in (...). A pool connectionInitSql, a driver option or a role or database setting can give the pooled sessions another value, and a proxy changes what a server limit means; dismiss a finding that does not apply to the real deployment.
A setting the server did not report (a role may be denied some), one this server version lacks, a value that does not parse, or a read that failed or was cut short is unknown, never a pass: the rule is SKIPPED for that datasource with the reason, and when another datasource is assessed the omission is reported as a coverage gap. Each finding is keyed on the datasource and the setting, never on the value.
| Rule | Server | Severity | Fires when |
|---|---|---|---|
DB-SERVER-001 | PostgreSQL | LOW | idle_in_transaction_session_timeout = 0 |
DB-SERVER-003 | PostgreSQL | MEDIUM | autovacuum = off |
DB-SERVER-004 | PostgreSQL | LOW | pg_stat_statements is not in shared_preload_libraries, or its extension is not created in the connected database |
DB-SERVER-005 | PostgreSQL | LOW | track_io_timing = off |
DB-SERVER-007 | MySQL | LOW | performance_schema = OFF |
DB-SERVER-008 | MySQL / MariaDB | MEDIUM | session sql_mode includes neither STRICT_TRANS_TABLES nor STRICT_ALL_TABLES |
DB-SERVER-001 - PostgreSQL does not end sessions that are idle in a transaction
LOW. Fires when idle_in_transaction_session_timeout is 0 (the default). A session left idle inside an open transaction is then never terminated, so it keeps its locks, and the PostgreSQL manual notes that an open transaction prevents vacuuming away recently dead tuples. The setting exists from PostgreSQL 9.6; a server that does not report it is SKIPPED as "no such setting" below that version and as unknown from it. A review prompt, not a defect: a server that only runs short, trusted transactions can keep 0. The PostgreSQL panel's Sessions section shows the sessions idle in a transaction right now. See idle_in_transaction_session_timeout.
DB-SERVER-002 - PostgreSQL has no statement timeout
Retired. Fires on stock PostgreSQL installations (statement_timeout = 0) and recommends setting a role or database statement_timeout on the application's DataSource role, which aborts Flyway or Liquibase DDL migrations (CREATE INDEX, ALTER TABLE) running over the same DataSource at startup.
DB-SERVER-003 - PostgreSQL autovacuum is disabled
MEDIUM. Fires when autovacuum = off. The anti-wraparound vacuum still runs, to prevent transaction ID wraparound, but routine vacuum and analyze never do, so dead tuples accumulate and planner statistics go stale unless something else vacuums and analyzes. It can be deliberate for a bulk load or with an external scheduler (dismiss it then). The PostgreSQL panel's Autovacuum health section shows the per-table state. See autovacuum.
DB-SERVER-004 - PostgreSQL pg_stat_statements is not available
LOW. Fires when pg_stat_statements cannot be used: it is not in shared_preload_libraries, or the extension is not created in the connected database (CREATE EXTENSION is per database, and select extname from pg_extension where extname = 'pg_stat_statements' limit ? is the bounded read). Without it the PostgreSQL panel's Statement ranking section is empty. Both halves must be known: if the library list is hidden from the role (no row), has no value or is malformed, or the extension read failed or was cut short, the rule is SKIPPED with that reason, even when the other half is known to be absent. shared_preload_libraries is hidden from a role that is neither a superuser nor a member of pg_read_all_settings, so on such a login the rule is SKIPPED; use a role that can read it.
shared_preload_libraries is a comma-separated list, so it is tokenised, never matched as a substring: it is split on , outside double quotes (a double-quoted entry may contain commas, and a doubled quote is one quote), each entry is trimmed, stripped of one pair of single quotes, reduced to its file name (a $libdir/ prefix or any other directory is dropped) and of a .so, .dylib or .dll suffix (the server accepts a library name with or without the platform suffix), and compared for equality with pg_stat_statements. pg_stat_statements_extra, my_pg_stat_statements, an empty value and a value that is not listed do not match. An unterminated quote, or text after a closing quote, makes the list unreadable and the rule SKIPPED. See pg_stat_statements.
DB-SERVER-005 - PostgreSQL does not measure I/O time
LOW. Fires when track_io_timing = off (the default; the setting exists from PostgreSQL 9.2): block read and write time is then missing from pg_stat_database, pg_stat_statements and EXPLAIN (ANALYZE, BUFFERS), so a slow statement cannot be told apart as I/O-bound from the server's own numbers. The timing adds a small overhead per block access, negligible on most current systems; the manual points to pg_test_timing to check it. See track_io_timing.
DB-SERVER-006 - PostgreSQL does not log slow statements
Retired. Fires on stock PostgreSQL installations (log_min_duration_statement = -1), is redundant with BootUI's SQL Trace panel, DB-SERVER-004 (pg_stat_statements), and HIB-CONFIG-006, and logs bound parameter literals into server logs in plaintext by default when enabled.
DB-SERVER-007 - MySQL Performance Schema is disabled
LOW. Fires on MySQL when performance_schema is OFF. It is on by default, so it was disabled on purpose or by a memory-saving configuration; without it the server keeps no statement digests, wait or lock instrumentation, which is the evidence behind the MySQL panel's Statement ranking, Sessions and blocking and Index handler sections. The variable is read-only at runtime. MariaDB is SKIPPED: it leaves the Performance Schema off by default and BootUI treats MariaDB as best effort. The variable exists from MySQL 5.5; below that the rule is SKIPPED as unsupported. See Performance Schema startup configuration.
DB-SERVER-008 - MySQL/MariaDB strict transactional SQL mode is disabled
MEDIUM. Fires on MySQL and MariaDB when the scan connection's session sql_mode contains neither STRICT_TRANS_TABLES nor STRICT_ALL_TABLES. Both MySQL 8.0+ and MariaDB 10.2.4+ enable STRICT_TRANS_TABLES by default; without a strict mode, out-of-range numbers, truncated strings and omitted NOT NULL columns can be coerced to implicit placeholders instead of raising an error. See MySQL strict SQL mode.
Retired rules
These IDs (along with DB-POOL-004, DB-SERVER-002, and DB-SERVER-006 above) remain reserved so old dismissals stay harmless and are never applied to unrelated future checks.
DB-SCHEMA-008 - Composite foreign key with partially nullable columns
Retired: mixed nullability can correctly model a required tenant and an optional relationship. MATCH SIMPLE and MATCH FULL differ; uniform nullability does not establish business intent. Making every column nullable can weaken integrity. See PostgreSQL foreign keys.
DB-SCHEMA-009 - Composite unique index with partially nullable columns
Retired: NULLS DISTINCT can be intentional, and Oracle rejects equal non-null portions of partially null composite unique keys, contrary to the previous generalized explanation. See Oracle integrity semantics.
DB-HIB-001 - Mapped foreign key column has no physical index
Retired: without a physical FK, the residual mapped association does not establish a child-side index need. Traversing an owning to-one association loads through the parent's referenced key. Physical FK access-path review remains DB-SCHEMA-002; workload-specific child lookup tuning is not inferred.
DB-HIB-008 - Hibernate sequence allocationSize does not match the physical sequence's INCREMENT BY
Retired: annotation allocation size alone lacks effective optimizer, mismatch strategy, qualified sequence and persistence-unit provenance. Hibernate's documented FIX strategy can override the mapping from the database. Compare effective generator contracts when diagnosing a real mismatch, not coincidentally equal bare names. See the matching Hibernate 7.4 API.
Deliberately not checked
No capacity-tuning verdicts on factory defaults: shared_buffers, effective_cache_size, random_page_cost, work_mem, innodb_buffer_pool_size and the redo log size are permanently "default" on a developer's local database, so a rule would only add noise, and the right value depends on a workload and a machine the advisor cannot see. The PostgreSQL and MySQL panels show them without a verdict. No aggregation of several pools onto one server, no DBCP2, Tomcat JDBC, c3p0 or Oracle UCP pools, no validation-query checks, no application row counts, index cardinality/usage, bloat, cache-size tuning, sequence gaps, blanket NOT NULL policy, automatic sequence restart, arbitrary query plans or production workload predictions. PostgreSQL data-type preferences from the community "Don't Do This" list (money, json versus jsonb, char(n), timetz) were reviewed and not added: each has intentional uses, and one rule-level dismissal would silence unrelated types. Catalog snapshots can change concurrently and depend on driver coverage and role visibility. Live MariaDB documentation is version-sensitive; Oracle 19c documentation can include later patch syntax. An unsupported or unverified capability stays unknown rather than being silently assumed absent.