Pith.

Databases · arXiv:2610.36418 v2 · submitted 26 Oct 2026

When the Application Layer Is Disposable: Putting Integrity Constraints Back in the Database

Hasara Kalumin, Amol Deshpande

The paper says

“Integrity constraints have been central to the relational model since its inception. However, beyond keys, single-row CHECKs, and referential integrity, most constraints are enforced by application layers today. SQL ASSERTIONs, standardized in SQL-92, remain poorly supported by major RDBMSs.”

more of the abstract

This has become increasingly unacceptable due to two developments. First, LLM-driven applications and agents increasingly issue queries and updates directly against databases, bypassing application layers where invariants reside. Such code may be generated on demand and discarded afterwards, making the database the only durable component that can encode and enforce these invariants. Second, natural constraints in higher-level conceptual models, such as E/R and property graphs, become fragmented across relations under mappings chosen for performance. The resulting multi-relation constraints lack direct database support, and only some can be efficiently enforced using existing mechanisms such as triggers. These developments motivate an overhaul of how constraints are defined, mined, managed, and enforced in data management systems. As a first concrete step, we introduce constraint indexes, which represent constraints spanning multiple relations as transactional access paths, and implement a proof of concept as a PostgreSQL extension. Constraint indexes enforce constraints arising from distributed inheritance hierarchies, folded relationships, and folded weak entities, as well as cardinality bounds and functional dependencies, at low overhead relative to no enforcement. Across these workloads, they outperform the better of the correctness-preserving baselines by up to 2.41 times. We also show that LLM-driven writers frequently violate unenforced constraints and behave erratically when provided with a list of constraints to enforce. We close by discussing a few research challenges raised by this agenda.

from the abstract

Pith says

Machine review · deepseek-v4-flash · 28 Oct 2026 · of version 1 of the paper; version 2 is newer · what was read was not recorded · not checked by a person

It can be wrong. Challenge this review or reply to it.

The passes disagreed. Reader: holds up. Skeptic: agrees with the reader. Referee: major revision.

A genuinely novel and carefully evaluated approach to enforcing multi-table integrity constraints, with an honest acknowledgment of its current prototype limitations. This line is wrong

3 major objections · 7 minor

How often objections from reviews like this one are right: not yet measured

Are you an author? What you can do.

Not checked: figures, code, what the references say.

The paper says, at §5 (b232) and §7 (b337)

The review did not quote this passage.

Pith says: Objection 1 of 3 · major

The paper's central claim (b337) states that constraint indexes can be 'compiled into transactional access paths at a cost low enough to leave switched on.' However, the prototype (b232) explicitly 'does not intercept or prevent direct SQL writes that bypass these operations.'

more of objection 1

The motivating scenario (LLM-driven writers generating plain INSERT/UPDATE) produces exactly such bypassing writes. Without a demonstrated interception mechanism, the claim is supported only for cooperative callers. The paper must either (a) revise the central claim to clearly state that the demonstration assumes writes are routed through the constraint-index operations, and discuss interception as an open problem, or (b) implement a concrete interception mechanism (e.g., using PostgreSQL rewrite rules or event triggers) and evaluate its overhead. The current framing overstates what is shown.

The paper says, at §6, Table 1 and b320

The review did not quote this passage.

Pith says: Objection 2 of 3 · major

The paper acknowledges that the Query and Query-trigger baselines run at READ COMMITTED and are not sound for several constraint types (b320). Yet the retention metric (% of No const throughput) uses No const as the reference, which is also unsound.

more of objection 2

If No const workloads can produce constraint-violating states, the overhead of correct enforcement may be understated. The authors should clarify whether the No const workload happens to avoid violations (e.g., by construction of the data generator) or, if not, discuss the implication for the retention numbers. Additionally, the speedup is reported against the better of Shadow or Shadow-trigger, but for some workloads these may not be maximally optimized relational baselines; a brief justification of their representativeness is needed.

The paper says, at §5.3

The review did not quote this passage.

Pith says: Objection 3 of 3 · major

The paper describes reconstruction of auxiliary state from durable relations after recovery but provides no measurements of reconstruction time or its impact on availability. For a system that aims to 'leave enforcement switched on,' the cost of rebuilding after a crash or restart is relevant. The authors should either report reconstruction latency (e.g., as a function of dataset size) or at least analyze the complexity and discuss how it could be mitigated (e.g., by incremental rebuild).

7 minor objections

The paper says, at §2.2

Pith says: minor objection 1 of 7

The LLM probe is limited to two models, one scenario per constraint, and five trials per condition. The results are illustrative but not statistically robust. The paper should more explicitly note this limitation.

The paper says, at Table 1, 'Belongs_to insert, single table'

Pith says: minor objection 2 of 7

The row 'vs. native PostgreSQL UNIQUE' compares only the hybrid configuration and may confuse readers. Consider labeling or separating it more clearly.

show 5 more

The paper says, at §5.1

Pith says: minor objection 3 of 7

The number of partitions (P) used in the experiments is not stated. Including it would help reproducibility.

The paper says, at §5.2

Pith says: minor objection 4 of 7

The SQL interface uses the function prefix 'inmem_person_identity', but the extension is named 'inmem_indexes'. Naming is inconsistent; consider aligning it.

The paper says, at Table 1 and text

Pith says: minor objection 5 of 7

The abbreviation 'Constr. idx.' appears in the table but the text consistently uses 'constraint index' or 'Constr. idx.'; please unify.

The paper says, at §6, end-to-end workload

Pith says: minor objection 6 of 7

The end-to-end workload composes several constraints but the paper does not break down the overhead per constraint type. A brief decomposition would help understand composition effects.

The paper says, at §2.2

Pith says: minor objection 7 of 7

The concurrency analysis of LLM-generated SQL is based on code inspection rather than actual execution under concurrent load. This is acceptable and is stated, but a clearer disclaimer would be helpful.

What would settle it

Implement a PostgreSQL interception layer (e.g., using event triggers on INSERT/UPDATE/DELETE on the relevant tables) that automatically calls the constraint-index operations (reserve, update, remove) before the base table modification, aborting the transaction if the constraint-index operation fails. Rerun the LLM-driven write scenario from Section 2.2 (with and without explicit constraints) using the interception layer enabled. Measure: (1) fraction of violating writes correctly rejected, (2) throughput compared to the non-intercepted constraint-index baseline from Table 1. If throughput degradation is more than 10% relative to the same workload with cooperative writes, the overhead of interception may justify a separate concern; if violations pass through, the enforcement model is incomplete.

from the skeptic's reading

How the review went

4 readings by deepseek-v4-flash · 28 Oct 2026

  1. Reader holds up confidence high
  2. Skeptic agrees 48 s · 19,723 tokens read, 5,693 written
  3. Editor wrote the verdict above 13 s · 20,501 tokens read, 1,610 written
  4. Referee major revision: 3 major objections, 7 minor 33 s · 20,061 tokens read, 4,096 written

Not run on this paper: the simulated authors' defence.

Pith did not check this review's objections against the paper.

The review in full

The review in brief, machine-written

Thanks for asking. This paper is worth reading. It tackles a real and growing problem: integrity constraints that span multiple relations are not enforced by databases, and with LLM-generated code, the application layer is no longer reliable. The authors propose constraint indexes — transactional access paths that materialize auxiliary state for multi-table constraints, maintained atomically with relational updates and synchronized via logical locking. That is a real conceptual advance: prior work treated validation and concurrency separately, or relied on triggers and shadow tables with ad hoc synchronization. The paper implements a PostgreSQL extension and evaluates it on a rich set of constraint types — hierarchy-wide uniqueness, folded weak entities, cardinality bounds, functional dependencies — showing 1.09x to 2.41x speedups over correct baselines while retaining 80–98% of unconstrained throughput. The evaluation is thorough and the numbers are credible.

The paper is honest about its limits. The prototype assumes all relevant writes use the hand-written constraint-index operations; it does not intercept bare SQL that bypasses them. The stress-test note correctly points out that the LLM scenario generates exactly such blind SQL, so the enforcement is not actually "switched on" for those writers without an interception layer. The authors mention standardized middleware as a possibility but do not build it. That is a genuine gap, but it is an acknowledged gap in a proof-of-concept paper, not a fatal flaw. The core idea — that a certain class of multi-table constraints can be compiled into efficient transactional structures — stands on its own. The interception problem is orthogonal and is a natural next step.

The paper is for database researchers interested in constraint enforcement, incremental maintenance, or the implications of LLM-generated SQL. It makes a solid contribution and would benefit from peer review that pushes on generality and integration. I would accept a review invitation and would bring it to a reading group.

Recommendation: peer review with the expectation that the authors address how interception could be integrated, but without requiring a full implementation for acceptance.

The strongest objection

The paper's strongest claim—that constraint indexes can be 'left switched on' to enforce multi-table constraints at low overhead—rests on the assumption that every write to the participating relations goes through the hand-written constraint-index operations. The current prototype (Section 5) explicitly states that it 'does not intercept or prevent direct SQL writes that bypass these operations.' The LLM probe in Section 2.2, which motivates the entire approach, shows that LLM-driven writers generate plain INSERT/UPDATE statements that make no use of these operations. Even when constraints were supplied as text, only a minority of generated SQL added any checks, and those checks were non-transactional and often incorrect under concurrency. The paper acknowledges that 'standardized middleware, that all writes are required to go through, could also provide a durable interface' but does not implement or evaluate any such interception. Without a mechanism to force all writes through the constraint-index path, the enforcement is not actually 'switched on'—it is only available to cooperative callers. The central claim is therefore conditional on a separate, non-trivial system component that has not been demonstrated.

The reader's weakest assumption correctly identifies the write-interception gap. This is the most load-bearing concern because it directly connects the paper's experimental demonstration (which assumes cooperative callers) with its motivating problem (LLM-driven writers that do not cooperate). Without a demonstrated interception path, the paper's central contribution—that constraint indexes can be 'switched on' to enforce constraints at low cost—is a proof of concept for a component rather than a complete solution. However, the paper explicitly acknowledges this limitation in Section 5 and treats it as future work, framing the prototype as a proof of concept for the enforcement mechanism itself, not for the full governance architecture. The experimental evaluation convincingly shows that conditional on cooperative writes, the overhead is low and concurrency control works. The LLM probe further strengthens the motivation for the approach, even though it does not solve interception. Therefore, while the write-interception gap is the most load-bearing concer, it does not invalidate the paper's central claim about the feasibility and performance of the constraint-index mechanism. The verdict of ACCEPT remains appropriate given the paper's scope and honest accounting of limitations. My recommendation is UNCHANGED, and I agree with the reader's assessment of the weakest assumption.

The referee's report

The paper addresses a timely problem: the erosion of the application layer as a reliable place for constraint enforcement in the age of LLM-generated code and conceptual-model-driven mappings. The constraint-index idea is novel—it unifies enforcement and synchronization by compiling constraints into compact, shared, transactionally maintained access paths. The experimental evaluation is thorough, covering multiple constraint types, baselines, and concurrency levels. The results provide strong evidence that a broad class of multi-table constraints can be enforced at low overhead, which has been a long-standing open problem in database systems. The paper is likely to influence both research on constraint enforcement and practical system design.

Pith's reading of the paper (a machine's summary, not the authors')

This paper argues that the usual division of labor — the database enforces keys, foreign keys, and row-level checks while application code enforces everything else — no longer works, because the application layer is the one component being thrown away: LLM-driven agents generate SQL on demand, run it once, and discard it, leaving the database as the only durable place an invariant can live. To close the gap it introduces constraint indexes, which compile constraints that span multiple relations into compact, transactionally maintained access paths instead of re-running validation queries. A PostgreSQL proof of concept enforces hierarchy-wide identity and email uniqueness, folded weak-entity identity, folded relationships, cardinality bounds, and functional dependencies, retaining 81.4 to 98.7 percent of the throughput of unconstrained execution and beating the better of the trigger and shadow-table baselines by up to 2.41x at 256 concurrent clients. The paper also reports that LLM-generated SQL applied no check whatsoever in 60 of 60 trials when constraints were not stated, and only one of 60 trials used a concurrency-safe strategy when they were, which is why it insists enforcement must live in the database itself.

What carries the argument. The load-bearing object is the constraint index: a compact shared auxiliary structure that stands in for a multi-relation constraint as an access path. It does not replicate tuples; it keeps only enforcement-relevant identities, unique values, and ownership links, so a transaction can reserve, update, or remove a conceptual identity by touching one object and its lookup entries instead of running validation queries over sibling tables. The subtle piece is that checking and synchronization are handled together: each operation acquires transaction-scoped logical locks on the conceptual keys derived from the constraint ($X$ on an entity key, shared on an owner key plus $X$ on the weak-entity discriminator, all in a global order to avoid deadlock), speculatively modifies the shared state, and logs inverse operations in a unified per-transaction undo journal replayed in reverse on abort. Because the auxiliary state is derived and non-durable, it is reconstructed from the durable relational tables after startup or recovery, which also means a constraint can be added or dropped by generating or discarding its structures.

Core claim. Constraint indexes demonstrate that one substantial class of constraints generated by conceptual models, long assumed too expensive to enforce, can be compiled into transactional access paths at a cost low enough to leave switched on. For each constraint domain the intended compiler emits five artifacts: auxiliary state $S_\Gamma$ holding compact enforcement objects (for the Person hierarchy, $\langle\text{person id}, \text{email}\rangle$ with an identity index and a uniqueness index; folded weak entities add a composite identity index and an owner-to-dependent index), operations such as reserve/require/update/remove, a lock specification mapping each operation to shared or exclusive transaction-scoped logical locks on conceptual keys, an undo specification with the inverse of every speculative change, and a reconstruction procedure that scans the base relations and rebuilds the state after recovery. Correctness is stated as $S_\Gamma = \Phi_\Gamma(D)$ at quiescent points, with every constraint-relevant write using the constraint-index operations in the same transaction as the relational update. The prototype, a PostgreSQL extension holding partitioned shared-memory hash tables, enforces the full set of evaluated constraints and, according to the experiments, not only stays cheap (81.4 to 98.7 percent of unconstrained throughput) but beats the correctness-preserving relational baselines by up to 2.41x. The LLM probe is part of the same argument: because generated SQL cannot be trusted to check invariants, the database must own both the specification and the enforcement.

The premise it rests on. The load-bearing premise is that every relevant write enters through the hand-written constraint-index operations in the same transaction as the relational update; the prototype does not intercept plain SQL that bypasses those operations, so a direct INSERT or UPDATE can silently leave the constraint violated.

If the paper is right (Pith's inferences, not the authors')

A substantial class of multi-relation constraints — hierarchy-wide uniqueness, folded weak-entity identity and ownership, folded relationships, cardinality bounds, and functional dependencies — can stay switched on, with 81.4 to 98.7 percent of unconstrained throughput retained across the evaluated workloads.

Constraint indexes beat the faster of the two correctness-preserving relational baselines (shadow tables and shadow-table triggers) on every key-oriented workload, by 1.09x to 2.41x, with the largest gains where one conceptual object must maintain several structures.

Because enforcement state is derived rather than stored relationally, constraints can be added or dropped by generating or discarding auxiliary structures and rebuilt from the base tables after a restart, with no persistent auxiliary relations and no WAL of their own.

The compilation recipe extends beyond keys to aggregate conditions such as two-sided cardinality bounds (2.41x over baselines) and functional dependencies (1.47x), though arbitrary assertions requiring unrestricted query evaluation may remain outside the approach.

Durable database-side enforcement is necessary rather than optional for LLM-driven writers: the probe found no checks in 60 of 60 trials without stated constraints and only one concurrency-safe strategy among 60 trials with them.

If constraint enforcement moves into the database, LLM prompts and agent code could stop carrying invariants altogether, and the rejection interface (violated constraint plus a witness naming the conflicting values) becomes the repair-loop contract that generated writers converge on; the paper lists this as an open challenge rather than a built feature.

The same shared auxiliary state could back a monitoring-only deployment that inspects a change stream instead of blocking writes, which the paper sketches for lakehouses; making that work requires the structures to represent violating data (duplicates) rather than reject it, which the paper leaves as future work.

The constraint-governor lifecycle — provisional alerting, promotion to blocking, demotion — implies that each constraint carries a measurable contention-versus-safety tradeoff, and for high-contention constraints weaker enforcement may be the right choice; the paper notes the tradeoff but does not formalize when promotion is justified.

Native engine integration would likely change the performance numbers: the prototype pays SQL-callable function boundaries and general-purpose advisory-lock overhead, so the measured gains are a lower bound on what purpose-built lock modes and planner-integrated maintenance could achieve.

Check this review

Pith stored no record of this review's passes and took no fingerprint of it. Reviews made by code from 13 Nov 2026 on carry both.

How often reviews like this one are right

Reviews like this one: written by deepseek-v4-flash, where what was read was not recorded.

How often objections from reviews like this one are right: not yet measured

Every value above, in the review's public record (JSON)

Reviews by people

This review was written by a machine. No person has reviewed this paper on Pith yet. A scientist listed on Pith can review it for a fee, and their review is published here whatever it concludes.

Request a human review

How Pith checks papers · The full audit of this paper

The paper

Abstract

Integrity constraints have been central to the relational model since its inception. However, beyond keys, single-row CHECKs, and referential integrity, most constraints are enforced by application layers today. SQL ASSERTIONs, standardized in SQL-92, remain poorly supported by major RDBMSs. This has become increasingly unacceptable due to two developments. First, LLM-driven applications and agents increasingly issue queries and updates directly against databases, bypassing application layers where invariants reside. Such code may be generated on demand and discarded afterwards, making the database the only durable component that can encode and enforce these invariants. Second, natural constraints in higher-level conceptual models, such as E/R and property graphs, become fragmented across relations under mappings chosen for performance. The resulting multi-relation constraints lack direct database support, and only some can be efficiently enforced using existing mechanisms such as triggers. These developments motivate an overhaul of how constraints are defined, mined, managed, and enforced in data management systems. As a first concrete step, we introduce constraint indexes, which represent constraints spanning multiple relations as transactional access paths, and implement a proof of concept as a PostgreSQL extension. Constraint indexes enforce constraints arising from distributed inheritance hierarchies, folded relationships, and folded weak entities, as well as cardinality bounds and functional dependencies, at low overhead relative to no enforcement. Across these workloads, they outperform the better of the correctness-preserving baselines by up to 2.41 times. We also show that LLM-driven writers frequently violate unenforced constraints and behave erratically when provided with a list of constraints to enforce. We close by discussing a few research challenges raised by this agenda.

The paper's own sentences, arranged, kept beside the review and separate from it. Each label is drawn from a closed vocabulary; the number beside it is the probability the classifier gave that label. No sentence in this record was written by a model.

abstract compiled · 2026-10-28

The authors' main claim, as the classifier picked it out 0.53

“These developments motivate an overhaul of how constraints are defined, mined, managed, and enforced in data management systems.”

How the main claim is stated: asserted 0.95

What the abstract itself states, as probabilities: claims first 0.27 · states limitation 0.62 · human participants 0.05 · controlled comparison 0.90 · randomized assignment 0.01 · states quantitative result 0.98 · compares with prior results 0.97 · mentions code or data availability 0.20

The abstract, sentence by sentence

This table labels the abstract only (arXiv listing abstract v1). The number is the probability the classifier gave the label.

SentenceRoleThe authors' own workStates the main conclusionStrength
Integrity constraints have been central to the relational model since its inception. background 1.00 0.03 0.02 asserted 1.00
However, beyond keys, single-row CHECKs, and referential integrity, most constraints are enforced by application layers today. background 0.81 0.07 0.03 asserted 1.00
SQL ASSERTIONs, standardized in SQL-92, remain poorly supported by major RDBMSs. background 0.87 0.05 0.02 asserted 1.00
This has become increasingly unacceptable due to two developments. background 0.73 0.05 0.03 asserted 0.93
First, LLM-driven applications and agents increasingly issue queries and updates directly against databases, bypassing application layers where invariants reside. background 0.93 0.08 0.04 asserted 0.98
Such code may be generated on demand and discarded afterwards, making the database the only durable component that can encode and enforce these invariants. background 0.77 0.11 0.06 hedged possibility 0.70
Second, natural constraints in higher-level conceptual models, such as E/R and property graphs, become fragmented across relations under mappings chosen for performance. background 0.93 0.09 0.02 asserted 0.99
The resulting multi-relation constraints lack direct database support, and only some can be efficiently enforced using existing mechanisms such as triggers. background 0.69 0.11 0.03 asserted 0.99
These developments motivate an overhaul of how constraints are defined, mined, managed, and enforced in data management systems. gap 0.33 0.09 0.18 asserted 0.95
As a first concrete step, we introduce constraint indexes, which represent constraints spanning multiple relations as transactional access paths, and implement a proof of concept as a PostgreSQL extension. contribution 0.96 0.96 0.18 asserted 1.00
Constraint indexes enforce constraints arising from distributed inheritance hierarchies, folded relationships, and folded weak entities, as well as cardinality bounds and functional dependencies, at low overhead relative to no enforcement. contribution 0.48 0.95 0.27 asserted 1.00
Across these workloads, they outperform the better of the correctness-preserving baselines by up to 2.41 times. result 1.00 0.95 0.19 asserted 1.00
We also show that LLM-driven writers frequently violate unenforced constraints and behave erratically when provided with a list of constraints to enforce. result 0.99 0.92 0.12 asserted 1.00
We close by discussing a few research challenges raised by this agenda. future work 1.00 0.39 0.04 unclear 0.91

What kind of paper the classifier reports this is: method or tool 1.00 · evidence from observation or experiment 0.97

What was examined, and what was not

Sources read

  • arXiv listing abstract v1

Not examined

  • full text
  • figures and tables
  • references and citing sentences
  • relations to other papers

Levels run

  • P abstract

Not run

  • S sections
  • T body sentences
  • C citations
  • R cross-paper relations

How the labels were made

Compiled by classifier-1.13.0 via TypeSafe API, question bank abstract-p1-20260923, 2026-10-28: 1 request, 10,060 input tokens.

Every quoted sentence on this record is the authors'. Every label is from Pith's closed vocabulary, with the probability shown beside it. This record as JSON

Figures (6)
Figure 1 of the paper
Figure 1. An example E/R diagram with two hierarchies and
Figure 2 of the paper
Figure 2. A shadow table enforces hierarchy-wide unique
Figure 3 of the paper
Figure 3. Constraint Governor Envisioned Architecture
Figure 4 of the paper
Figure 4. PostgreSQL constraint-index architecture. Shared-memory indexes store derived constraint state, advisory locks
Figure 5 of the paper
Figure 5. Partitioned implementation of one shared hash
Figure 6 of the paper
Figure 6. Scalability of contributes_to inserts under the two-sided Person–Content cardinality constraint. enforce all evaluated constraints. The largest gain is for Person insertion. Updating IdCard.card_no achieves a 1.35× improve￾ment: relational enforcement separately maintains extracted iden￾tity and unique-value state, whereas the constraint index updates one conceptual object and its lookup entries directly. The small￾est gain is for simple Belongs_to insertion, where the underlying owner-tuple update dominates execution. For Belongs_to inserts under the mapping that stores the…

Figures are the authors', reproduced from the paper.

Cited by 1 Pith paper

Challenges and discussion

Disagree with the review, or know something it missed? Leave a comment, or challenge this review formally: a challenge becomes a permanent entry in this paper's record, and its decision is published here.

No comments yet.

Sign in to comment