arXiv:2609.02328cs.DBSep 2026

Manuscript Offprint

arXiv:2609.02328

Poisoning Attacks on the PGM-index

Atsuki Sato, Martin Aumüller, Yusuke Matsui

Atsuki Sato

a_sato@hal.t.u-tokyo.ac.jp

Graduate School of Information

Science and Technology, The

University of Tokyo

Tokyo, Japan

Martin Aumüller

maau@itu.dk

Algorithms Group, IT University of

Copenhagen

Copenhagen, Denmark

Yusuke Matsui

matsui@hal.t.u-tokyo.ac.jp

Graduate School of Information

Science and Technology, The

University of Tokyo

Tokyo, Japan

ABSTRACT

The PGM-index (Ferragina and Vinciguerra, VLDB'20) is one of the most practical learned indexes, owing to its theoretical elegance and consistently strong empirical performance. It is built on optimal piecewise linear approximations (PLAs) that minimize the number of segments. In this paper, we ask how sensitive this optimal PLA itself is to poisoning attacks. We propose PGM-ATTACK, an efficient poisoning attack that sequentially inserts adversarial keys to inflate the resulting number of segments, and we develop a method for deriving theoretical upper bounds on the number of segments attainable under arbitrary insertions. Our experiments show that poisoning only 10% of the keys allows PGM-ATTACK to increase the segment count by up to 120×. On every evaluated instance, our instance-dependent upper bound is at most 1.92× the segment count attained by PGM-ATTACK, certifying that PGM-ATTACK achieves at least 52% of the optimum. This increase in the number of segments enlarges the PGM-index by up to 120×. Moreover, the attack also transfers to other learned indexes, substantially inflating the index size of PLA-based ones in particular. Our results reveal that, despite the optimality of its PLAs, the PGM-index has an intrinsic vulnerability rooted in its optimization objective, motivating robustness-aware objective design for future learned indexes.

1 INTRODUCTION

In recent years, learned indexes [23] have attracted considerable attention as space-efficient, high-performance alternatives to traditional index structures such as B+-trees. The PGM-index [16] is a leading example. It recursively constructs optimal piecewise linear approximations (PLAs) of the cumulative distribution function (CDF), where an optimal PLA is one that uses the minimum number of segments. This optimality allows the PGM-index to provide worst-case theoretical guarantees while achieving a favorable trade-off between memory usage and query time. These properties make the PGM-index an appealing choice for large-scale settings where both practical efficiency and worst-case guarantees matter, and it has begun to be adopted in high-performance database systems and search engines [19, 28].

As learned indexes become increasingly practical, understanding their robustness becomes correspondingly important. By quantifying how much an index's memory efficiency and query performance can deteriorate after the insertion of a small amount of data, we can assess its stability and deploy it with greater confidence. For traditional indexes, such effects are often straightforward to characterize: for example, a B+-tree requires Θ(n)\Theta(n) space and supports queries in Θ(log⁡n)\Theta(\log n) time, making the impact of a small increase in the number of keys readily predictable. For learned indexes, however, the impact

P1: Maximum-Error Maximization (Section 3)

Figure

Structural Theorems:

Thm. 1 OPT Thm. 2 Duplicate-OPT

Thm. 3 Consecutive

Consecutive: optimal in 99.9% of cases.

Thm. 4 connects P1 and P2: P2 reduces to P1.

P2: Covered-Legitimate-Keys Minimization (Section 4)

Figure

Poisoning methods:

Consecutive DI-Consecutive

DI-Con: almost the same performance as Con, up to 1,000×1,000 \times faster.

Repeatedly apply DI-Consecutive

P3: Segment Maximization (Section 5)

Figure

PGM-attack

10% poison ▶ up to 120× #Seg.

Upper bounds on #Seg.

They show PGM-attack achieves ≥ 0.52× of optimal.

Figure 1: Our bottom-up approach progresses from maximum-error maximization (P1), through covered-key minimization (P2), to segment maximization (P3). The P3 panel illustrates how our PGM-ATTACK can effectively degrade a PLA: before poisoning, a single segment suffices to approximate the ranks of all keys within error ε=1\varepsilon = 1, whereas inserting only two poison keys increases the required number of segments to three.

is far less clear because their performance can depend sensitively on the data distribution. Motivated by this concern, recent studies have investigated attacks against several learned indexes, including poisoning attacks against mean-squared-error (MSE) minimizing linear models and Recursive Model Indexes (RMIs) [22, 23, 34], as well as algorithmic-complexity attacks against ALEX [10, 35, 36].

We note that, although the PGM-index enjoys several theoretical guarantees, its robustness against poisoning (or, more generally, against data insertions) remains largely uncharacterized, which is an important concern in practical deployments. For example, the PGM-index has a worst-case guarantee of provably superior performance to conventional B+-trees [16], but this guarantee does not imply robustness against poisoning: the strength of the PGM-index lies in the fact that it typically performs far better than B+-trees, and if a small number of poison keys can drive its performance toward this worst case, this strength is lost. Moreover, in terms of sensitivity to attacks, i.e., the discrepancy between the performance before and after an attack, the PGM-index may even be more sensitive than a conventional B+-tree. Such sensitivity poses a serious problem when deploying the PGM-index in real systems: database administrators are often drawn to the PGM-index for its high performance, yet they would have to worry that its benefits might be largely eliminated by only a small number of key insertions.

In this paper, we propose PGM-ATTACK, a poisoning attack against PLA-based learned indexes, including the PGM-index. PGM-ATTACK substantially increases the number of segments in the optimal PLA, which forms the bottom-level PLA of the PGM-index. The key-rank plots at the bottom of Figure 1 show an illustrative example; inserting only two poison keys increases the number of segments from one to three. Because these bottom-level segments dominate the model size of the PGM-index, increasing their number reduces compression efficiency and can degrade query performance through more cache misses and larger upper-level structures.

Analyzing poisoning attacks against PLAs is challenging for several reasons. First, this problem is difficult to analyze theoretically because even the basic building block of PLA construction (maximum-error-minimizing linear regression) does not admit a simple closed-form solution. This is clearly distinct from the MSE-minimizing regression considered in prior work [22, 34], which admits a closed-form solution. Second, inserting a poison key shifts the ranks of all subsequent keys and can change the boundaries and sizes of later segments, causing cascading changes throughout the segmentation. Prior attacks against RMI's [22] do not need to account for such global effects because they assume that each linear regression model covers a fixed number of keys. Finally, simple strategies such as inserting a consecutive run of keys, as used in algorithmic-complexity attacks against ALEX [35, 36], are ineffective at increasing the total number of PLA segments. Such keys can typically be absorbed into a single PLA segment and therefore have little effect on the segment count.

To address these challenges, we adopt a bottom-up approach that proceeds from simpler subproblems to our final objective, as illustrated in Figure 1. We first analyze P1, the problem of maximizing the maximum error of linear regression. The resulting insights allow us to solve P2, which minimizes the number of legitimate keys covered by a single segment. Finally, by repeatedly solving P2, we address P3, which maximizes the total number of segments in the PLA, thereby constructing PGM-ATTACK. We also propose algorithms for deriving upper bounds on the number of segments attainable under arbitrary key insertions. Our experiments show that poisoning only 10% of the keys can increase the number of segments by up to 120×. These results reveal that, despite the optimality of its PLAs, the PGM-index has an intrinsic vulnerability rooted in its optimization objective. This motivates the design of future learned indexes with more robustness-aware objectives.

Contributions. Our contributions are summarized as follows:

  • We formulate three new poisoning problems on the CDF: P1, maximizing the maximum error in linear regression; P2, minimizing the number of covered legitimate keys in linear regression; and P3, maximizing the number of segments in the PLA.

  • For P1, we characterize optimal poison sets (Section 3) and show experimentally that appropriately selected consecutive-integer poison keys are almost always optimal (Section 6.2).

  • For P2, we prove a reduction to P1 and develop a near-linear-time algorithm (Section 4). We experimentally show that this algorithm generates near-optimal consecutive-integer poison keys (Section 6.3).

  • For P3, we propose PGM-ATTACK, which repeatedly generates candidate poison sets for P2 and sequentially selects among them (Section 5.2). Injecting 10% poison keys increases the segment count and PGM-index size by up to 120×. The attack also transfers to other learned indexes, particularly inflating the size of PLA-based ones (Sections 6.4 and 6.5).

  • For P3, we also propose algorithms for upper-bounding the number of segments attainable under arbitrary key insertions (Sections 5.3 and 5.4). On all evaluated instances, the resulting upper bound is at most 1.92×1.92 \times the segment count obtained by PGM-ATTACK, certifying that the attack achieves at least 52% of the optimum on these instances (Section 6.4).