L EARNED I NDEX WITH D YNAMIC (cid:15)
Anonymous authors
Paper under double-blind review
A BSTRACT
Index structure is a fundamental component in database and facilitates broad data retrieval applications.
Recent learned index methods show superior performance by learning hidden yet useful data distribution with the help of machine learning, and provide a guarantee that the prediction error is no more than a pre-deﬁned (cid:15) .
However, existing learned index methods adopt a ﬁxed (cid:15) for all the learned segments, neglecting the diverse characteristics of different data localities.
In this paper, we propose a mathematically-grounded learned index framework with dynamic (cid:15) , which is efﬁcient and pluggable to existing learned index methods.
We theoretically analyze prediction error bounds that link (cid:15) with data characteristics for an illustrative learned index method.
Under the guidance of the derived bounds, we learn how to vary (cid:15) and improve the index performance with a better space-time trade-off.
Experiments with real-world datasets and several state-of-the-art methods demonstrate the efﬁciency, effectiveness and usability of the proposed framework.
I NTRODUCTION
Data indexing (Graefe & Kuno, 2011; Wang et al., 2018; Luo & Carey, 2020;
Zhou et al., 2020), which stores keys and corresponding payloads with designed structures, supports efﬁcient query operations over data and beneﬁts various data retrieval applications.
Recently, Machine Learning (ML) models have been incorporated into the design of index structure, leading to substantial improvements in terms of both storage space and querying efﬁciency (Kipf et al., 2019; Ferragina & Vinciguerra, 2020a;
Mitzenmacher, 2018; Vaidya et al., 2021).
The key insight behind this trending topic of “learned index” is that the data to be indexed contain useful distribution information and such information can be utilized by trainable ML models that map the keys to their stored positions.
State-of-the-art learned index methods (Galakatos et al., 2019;
Kipf et al., 2020; Ferragina & Vinciguerra, 2020b; Ferragina et al., 2020) adopt piece-wise linear segments to approximate the data distribution and introduce an important pre-deﬁned parameter (cid:15) .
These methods ensure that the maximal prediction error of each learned segment is no more than (cid:15) and provide a worst-case guarantee of querying efﬁciency.
By tuning (cid:15) , various space-time preferences from users can be met.
For example, a relatively large (cid:15) can result in a small index size while having large prediction errors, and on the other hand, a relatively small (cid:15) provides with small prediction errors while having more learned segments and thus a large index size.
However, existing learned index methods implicitly assume that the whole dataset to be indexed contains the same characteristics for different localities and thus adopt the same (cid:15) for all the learned segments, leading to sub-optimal index performance.
More importantly, the impact of (cid:15) on index performance is intrinsically linked to data characteristics, which are not fully explored and utilized by existing learned index methods.
Motivated by these, in this paper, we theoretically analyze the impact of (cid:15) on index performance, and link the characteristics of data localities with the dynamic adjustments of (cid:15) .
Based on the derived theoretical results, we propose an efﬁcient and pluggable learned index framework that dynamically adjusts (cid:15) in a principled way.
To be speciﬁc, under the setting of an illustrative learned index method MET (Ferragina et al., 2020), we present novel analysis about the prediction error bounds of each segment that link (cid:15) with the mean and variance of data localities.
The segment-wise prediction error embeds the space-error trade-off as it is the product of the number of covered keys and mean absolute error , which determine the index size and preciseness respectively.
The derived mathematical relationships enable our framework to fully explore diverse data localities with an (cid:15) -learner module, which learns to predict the impact of (cid:15) on the index performance and adaptively choose a suitable (cid:15) to achieve a better space-time trade-off.
We apply the proposed framework to several state-of-the-art (SOTA) learned index methods, and conduct a series of experiments on three widely adopted real-world datasets.
Comparing with the original learned index methods with ﬁxed (cid:15) , our dynamic (cid:15) versions achieve signiﬁcant index performance improvements with better space-time trade-offs.
We also conduct various experiments to verify the necessity and effectiveness of the proposed framework, and provide both ablation study and case study to understand how the proposed framework works.
B ACKGROUND 2. (cid:15) - BOUNDED L EARNED I NDEX
Given a dataset D = { ( x, y ) | x ∈ X , y ∈ Y} , X is the set of keys over a universe U such as reals or integers, and Y is the set of positions where the keys and corresponding payloads are stored.
The index such as B + -tree (Abel, 1984) aims to build a compact structure to support efﬁcient query operations over D .
Typically, the keys are assumed to be sorted in ascending order to satisfy the key-position monotonicity , i.e. , for any two keys, x i > x j iff their positions y i > y j , such that the range query ( X ∩ [ x low , x high ] ) can be handled.
Recently, learned index methods (Kraska et al., 2018;
Li et al., 2019; Tang et al., 2020; Dai et al., 2020;
Crotty, 2021) leverage ML models to mine useful distribution information from D , and incorporate such information to boost the index performance.
To look up a given key x , the learned index
ﬁrst predicts position ˆ y using the learned models, and subsequently ﬁnds the stored true position y based on ˆ y with a binary search or exponential search.
Thus the querying time consists of the inference time of the learned models and the search time in O (log( | ˆ y − y | )) .
By modeling the data distribution information, learned indexes achieve faster query speed than traditional B + -tree index, meanwhile using several orders-of-magnitude smaller storage space (Ding et al., 2020; Galakatos et al., 2019;
Ferragina & Vinciguerra, 2020b; Kipf et al., 2020; Marcus et al., 2020).
Many existing learned index methods adopt piece-wise linear segments to approximate the distribution of D due to their effectiveness and low computing cost, and introduce the parameter (cid:15) to provides a worst-case preciseness guarantee and a tunable knob to meet various space-time trade-off preferences.
Here we brieﬂy introduce the SOTA (cid:15) -bounded learned index methods that are most closely to our work, and refer to the review chapter of (Ferragina & Vinciguerra, 2020a) for details of other methods.
Speciﬁcally, Galakatos et al.
(2019) greedily learn a set of piece-wise linear segments in a one-pass manner.
Ferragina & Vinciguerra (2020b) adopt another one-pass algorithm that achieves the optimal number of learned segments.
Kipf et al.
(2020) introduce a radix structure to organize the learned segments.
Ferragina et al.
(2020) adopt a ﬁxed slope setting for all learned segments.
Existing methods constraint all learned segments with the same (cid:15) , i.e. , the learning process ensures that the maximum prediction error is within a pre-deﬁned (cid:15)
where (cid:15) ∈ Z > 1 .
In this paper, we will discuss the impact of (cid:15) in more depth and invistigate how to enhance existing learned index methods from a new perspective: dynamic adjustment of (cid:15) considering the diversity of different data localities.
2. M EAN E XIT T IME (MET) A LGORITHM
Here we describe an illustrative learned index algorithm MET (Ferragina et al., 2020).
Speciﬁcally, for any two consecutive keys of D , suppose their key interval ( x i − x i − 1 ) is drawn according to a random process { G i } i ∈ N , where G i is a positive independent and identically distributed (i.i.d.)
random variable whose mean is µ and variance is σ 2 .
The MET algorithm learns linear segments
S =
[ S 1 , ..., S i , ..., S N ] in one pass, where S i : y
= a i x + b i is the learnable linear segment and N is the total number of learned segments.
The learning process is as follows:
The current linear segment ﬁxes the slope a i = 1 /µ and goes through the ﬁrst available data point, thus b
i is also determined.
Then the segment covers as many data points as possible until a data point, say ( x (cid:48) , y (cid:48) )
achieves the prediction error larger than (cid:15) .
The violation of (cid:15) triggers a new linear segment, and the data point ( x (cid:48) , y (cid:48) ) will be the ﬁrst available data point, and the process repeats until no data point is available.
Although the MET algorithm adopts a simple learning mechanism, it makes the theoretical analysis convenient by modeling the learning process as a random walk process.
Other (cid:15)
-bounded learned index methods such as FITing-Tree (Galakatos et al., 2019), PGM (Ferragina & Vinciguerra, 2020b) and Radix-Spline (Kipf et al., 2020) learn linear segments in a similar manner while having different mechanisms to determine the parameters of { S i } .
Ferragina et al.
(2020) reveal the relationship between (cid:15) and index size performance based on MET.
In Section 3.3, we present novel analysis about the impact of (cid:15) on not only the index size, but also the index preciseness and a comprehensive trade-off quantity , which facilitates the proposed dynamic (cid:15) adjustment.
L EARN TO V ARY (cid:15) 3. P ROBLEM F ORMULATION AND M OTIVATION
Before introducing the proposed framework, we ﬁrst formulate the task of learning index from data with (cid:15) guarantee, and provide some discussions about why we need to vary (cid:15) .
Given a dataset
D to be indexed and an (cid:15) -bounded learned index algorithm A , we aim to learn segments S =
[ S 1 , ..., S i ..., S N ] as index structure such that the size of S and (cid:80) Ni =1 MAE ( D i | S i ) are both small, where S i is the i -th learned linear segment with the parameter (cid:15) i , MAE is the mean absolute prediction error, and D i ⊂ D is the data whose keys are covered by S i .
For the remaining data D \ (cid:83) j<i D j , the algorithm A repeatedly checks whether the prediction error of new data point violates the given (cid:15) i , and outputs the learned segment S i that covers D i .
When all the (cid:15) i s for i ∈
[ N ] take the same value, the problem becomes the one that existing learned index methods are dealing with.
Now let’s examine the effect of parameter (cid:15) .
To query a speciﬁc data point, say ( x, y ) , we ﬁrst need to ﬁnd the speciﬁc segment S (cid:48) that covers x , and then search its true position y based on the estimated one ˆ y = S (cid:48)
( x ) .
For the ﬁrst step, we can ﬁnd S (cid:48) from S in O (log( N )) ; for the second step, the search of y based on ˆ y can be done in O (log( | ˆ y − y | )) .
In summary, we can ﬁnd the true position of the queried data point in O (log( N ) + log( | ˆ y − y | )) 1 .
From here, we can see that the parameter (cid:15) plays an important role to trade off two contradictory performance terms, i.e. , the size of the learned index N , and MAE of the whole data MAE ( D| S ) .
If we adopt a small (cid:15) , the maximal prediction error constraint is more frequently violated, leading to a large N ; meanwhile, the preciseness of learned index is improved, leading to a small MAE ( D| S ) .
On the other hand, with a large (cid:15) , we will get a more compact learned index ( i.e. , a small N ) with larger prediction errors ( i.e. , a large MAE ( D| S ) ).
Thus these two inversely changed terms jointly impact the querying efﬁciency.
Actually, the effect of (cid:15) on index performance is intrinsically linked to the characteristic of the data to be indexed.
For real-world datasets, an important observation is that the linearity degree varies in different data localities .
Recall that we use piece-wise linear segments to ﬁt the data, and (cid:15) determines the partition and the ﬁtness of the segments.
By varying (cid:15) , we can adapt to the local variations of D and adjust the partition such that each learned segment ﬁts the data better.
Formally, let’s consider the quantity SegErr i that is deﬁned as the total prediction error within a segment S i , i.e. , SegErr i = (cid:80) ( x,y ) ∈D i | y − S
i ( x ) | , which is also the product of the number of covered keys
Len ( D i ) and the mean absolute error MAE ( D i | S i ) .
Note that a large Len ( D i ) leads to a small N since |D| = (cid:80) Ni =
Len ( D i ) .
From this view, the quantity SegErr i internally reﬂects the space-error trade-off.
Later we will show how to leverage this quantity to dynamically adjust (cid:15) .
3. O
In practice, it is intractable to directly solve the problem formulated in Section 3.1.
With a given (cid:15) i , the one-pass algorithm
A determines S i and D i until the error bound (cid:15)
i is violated.
In other words, it is unknown what the data partition {D i } will be a priori , which makes it impossible to solve the problem by searching among all the possible { (cid:15) i } s and learning index with a set of given { (cid:15) i } .
In this paper, we investigate how to efﬁciently ﬁnd an approximate solution to this problem via the introduced (cid:15) -learner module.
Instead of heuristically adjusting (cid:15) , the (cid:15) -learner learns to predict the impact of (cid:15) on the index structure and adaptively adjusts (cid:15) in a principled way.
Meanwhile, the introducing of (cid:15) -learner should not sacriﬁce the efﬁciency of the original one-pass learned index algorithms, which is important for real-world practical applications.
These two design considerations establish our dynamic (cid:15) framework as shown in Figure 1.
The (cid:15) -learner is based on an estimation function SegErr = f
( (cid:15), µ, σ ) that depicts the mathematical relationships among (cid:15) , SegErr i and the characteristics µ, σ of the data to be indexed.
As a start, users can provide an expected ˜ (cid:15) that indicates various preferences under space-sensitive or time-sensitive applications.
To meet the user requirements, afterwards, we will internally transform the ˜ (cid:15) into another
[Figure]
proxy quantity (cid:94) SegErr , which reﬂects the expected prediction error for each segment if we set (cid:15) i = ˜ (cid:15) .
This transformation also links the adjustment of (cid:15) and data characteristics together, which enables the data-dependent adjustment of (cid:15) .
Beginning with ˜ (cid:15) , the (cid:15) -learner chooses a suitable (cid:15) i according to current data characteristics, then learn a segment S i using A , and ﬁnally enhance the (cid:15) -learner with the rewarded ground-truth SegErr i of each segment.
To make the introduced adjustment efﬁcient, we propose to only sample a small Look-ahead data D (cid:48) to estimate the characteristics ( i.e. , µ and σ ) of the following data locality.
The learning and adjusting processes are repeatedly conducted and also in an efﬁcient one-pass manner.
Note that the proposed framework provides users the same interface as the ones used by original learned index methods.
That is, we add no any additional cost to the users’ experience, and users can smoothly and painlessly use our framework with given ˜ (cid:15) just as they use the original methods with given (cid:15) .
The (cid:15) is an intuitive, easy-to-set and method-agnostic quantity for users.
On the one hand, we can easily impose restrictions on the worst-case querying cases with (cid:15) as the data accessing number in querying process is O (log( | ˆ y − y | )) .
On the other hand, (cid:15) is easier to estimate than the other quantities such as index size and querying time, which are dependent on speciﬁc algorithms, data layouts, implementations and experimental platforms.
Our pluggable framework retains the beneﬁts of existing learned index methods, such as the aforementioned usability of (cid:15) and the ability to handle dynamic update case (Galakatos et al., 2019; Ferragina & Vinciguerra, 2020b).
We have seen how (cid:15) determines index performance and how SegErr i embeds the space-error tradeoff in Section 3.1.
In Section 3.3, we will further theoretically analyze the relationship among (cid:15) ,
SegErr i , and data characteristics µ, σ at different localities.
Based on the analysis, we elaborate the details of (cid:15) -learner and the internal transformation between (cid:15) and SegErr i in Section 3.4.
3. P REDICTION E RROR E STIMATION
In this section, we will theoretically study the impact of (cid:15) on the prediction error SegErr i of each learned segment S i .
Speciﬁcally, for the MET algorithm, we can prove the following theorem to bound the expectation of SegErr i with (cid:15) and the key interval distribution of the data to be indexed.
Theorem 1.
Given a dataset D to be indexed and an (cid:15)
where (cid:15) ∈ Z > 1 , consider the setting of the
MET algorithm
(Ferragina et al., 2020), in which key intervals of D are drawn from a random process consisting of positive i.i.d.
random variables with mean µ and variance σ 2 , and (cid:15) (cid:29) σ/µ .
For a learned segment S i and its covered data D i , denote SegErr i = (cid:80) (
x,y ) ∈
D i | y − S i ( x ) | .
Then the expectation of SegErr i satisﬁes:
[Equation]
This theorem reveals that the prediction error SegErr i depends on both (cid:15) and the data characteristics ( µ and σ ).
Recall that CV = σ/µ is the coefﬁcient of variation , a classical statistical measure of the relative dispersion of data points.
In the context of the linear approximation, the data statistic 1 /CV =
µ/σ in our bounds intrinsically corresponds to the linearity degree of the data.
With this, we can ﬁnd that when µ/σ is large, the data is easy-to-ﬁt with linear segments, and thus we can choose a small (cid:15) to achieve precise predictions.
On the other hand, when µ/σ is small, it becomes harder to ﬁt the data using a linear segment, and thus (cid:15) should be increased to absorb some non-linear data localities.
In this way, we can make the total prediction error SegErr i for different learned segments consistent and achieve a better space-error trade-off.
This analysis also conﬁrms the motivation of varying (cid:15) :
The local linearity degrees of the indexed data can be diverse, and we should adjust (cid:15) according to the local characteristic of the data, such that the learned index can ﬁt and leverage the data distribution better.
In the design of the (cid:15) -learner module (Section 3.4), we will take the derived closed-form relationships among SegErr i , (cid:15) and data statistic µ/σ into account.
In the rest of this section, we provide a proof sketch of this theorem due to the space limitation.
For detailed proof, please refer to our Appendix.
The main idea is to model the learning process of linear approximation with (cid:15) guarantee as a random walk process, and consider that the absolute prediction error of each data point follows folded normal distributions.
Speciﬁcally, given a learned segment
S i : y = a i x + b i , we can calculate the expectation of SegErr i for this segment as:
[Equation]
where Z j is the j -th position of a transformed random walk { Z j } j ∈ N , j ∗ = max { j ∈ N | −
[Equation]
/a
i ≤
Z j ≤ (cid:15)/a i } is the random variable indicating the maximal position when the random walk is within the strip of boundary ± (cid:15)/a i , and the last equality is due to the deﬁnition of expectation.
Under the MET algorithm setting where a i = 1 /µ and (cid:15) (cid:29) σ/µ , we can show that the increments of the transformed random walk { Z j } have zero mean and variance σ 2 , and many steps are necessary to reach the random walk boundary.
With the Central Limit Theorem, we can assume the Z j follows normal distribution with mean µ zj = 0 and variance σ 2 zj = jσ 2 , and thus | Z j | follows the folded normal distribution with expectation E ( | Z j | ) =
(cid:112) 2 /πσ √ j .
Thus Eq.
(1) can be written as
[Equation]
Using E [ j ∗ ]
= µ 2 σ 2 (cid:15) 2 and V ar
[ j ∗ ] =
2 3 µ 4 σ 4 (cid:15) 4 as derived in (Ferragina et al., 2020), we get E [( j ∗ ) 2 ] =  µσ 4 (cid:15) 4 .
With the inequality (cid:80) n − 1 j =0 √ j < 23 n √ n and E [ X 34 ] ≤ ( E [ X ]) 34 , we get the upper bound:
[Equation]
For the lower bound, applying the triangle inequality into Eq.
(1), we can get E [ SegErr i ] >µ
[Equation]
∞ n =1 E [ | Z | ]
Pr( j ∗ = n ) , where Z = (cid:80) n − 1 j =
Z j , and Z follows the normal distribution since
Z j ∼ N (0 , σ 2 zj ) .
We can prove that | Z | follows the folded normal distribution whose expectation
E [ | Z | ] > σ ( n − 1) / √ π .
Thus the lower bound is:
[Equation]
Since (cid:15) (cid:29) σµ , we can omit the right term (cid:112) 1 /π · σ/µ and ﬁnish the proof.
Although the derivations are based on the MET algorithm whose slope is the reciprocal of µ , we found that the mathematical forms among (cid:15) , µ/σ and SegErr i are still applicable to other (cid:15) -bounded methods, and further prove that the learned segment slopes of other methods are close to the reciprocal of expected key intervals in Appendix.
We will empirically show the links between MET and other SOTA (cid:15) -bounded methods, and how effectively the proposed framework works for them on real-world datasets (Section 4.2).
3. (cid:15) -L EARNER
Now given an (cid:15) , we have obtained the closed-form bounds of the SegErr in Theorem 1, and both the upper and lower bounds are in the form of w 1 ( µ σ ) w 2 (cid:15) w 3 , where w 1 , 2 , 3 are some coefﬁcients.
As the concrete values of these coefﬁcients can be different for different datasets and different methods, we propose to learn the following trainable estimator to make the error prediction preciser:
[Equation]
With this learnable estimator, we feed data characteristic µ/σ of the look-ahead data and the transformed (cid:94) SegErr into it and ﬁnd a suitable (cid:15) ∗ as (cid:16) (cid:94) SegErr/w 1 ( µσ ) w 2 (cid:17) 1 /w 3 .
We will discuss the look-ahead data and the transformed (cid:94) SegErr in the following paragraphs.
Now let’s discuss the reasons for how this adjustment can achieve better index performance.
Actually, the (cid:15) -learner proactively plans the allocations of the total prediction error indicated by user ( i.e. , ˜ (cid:15) · |D| ) and calculates the tolerated (cid:94) SegErr for the next segment.
By adjusting current (cid:15) to (cid:15) ∗ , the following learned segment can fully utilize the distribution information of the data and achieve better performance in terms of space-error trade-off.
To be speciﬁc, when µ/σ is large, the local data has clear linearity, and thus we can adjust (cid:15) to a relatively small value to gain precise predictions; although the number of data points covered by this segment may decrease and then the number of total segments increases, such cost paid in terms of space is not larger than the beneﬁt we gain in terms of precise predictions.
Similarly, when µ/σ is small, (cid:15) should be adjusted to a relatively large value to lower the learning difﬁculty and absorb some non-linear data localities; in this case, we gain in terms of space while paying some costs in terms of prediction accuracy.
The segment-wise adjustment of (cid:15) improves the overall index performance by continually and data-dependently balancing the cost of space and preciseness.
Look-ahead Data.
To make the training and inference of the (cid:15) -learner light-weight, we propose to look ahead a few data D (cid:48) to reﬂect the characteristics of the following data localities.
Speciﬁcally, we leverage a small subset D (cid:48)
⊂ D \ (cid:83) j<i D j to estimate the value µ/σ for the following data.
In practice, we set the size of D (cid:48) to be 404 when learning the ﬁrst segment as initialization, and (cid:0)( i − 1) (cid:80) i − 1 j =1 Len ( D j ) (cid:1) · ρ for the other following segments.
Here ρ is a pre-deﬁned parameter indicating the percentage that is relative to the average number of covered keys for learned segments, considering that the distribution of µ/σ can be quite different to various datasets.
As for the ﬁrst segment, according to the literature (Kelley, 2007), the sample size 404 can provide a 90% conﬁdence intervals for a coefﬁcient of variance σ/µ ≤ 0 . 2 .
(cid:94) SegErr and Optimization.
As aforementioned, taking the user-expected ˜ (cid:15) as input, we aim to reﬂect the impact of ˜ (cid:15) with a transformed proxy quantity (cid:94) SegErr such that the (cid:15) -learner can choose suitable (cid:15) ∗ to meet users’ preference while achieving better space-error trade-off.
Speciﬁcally, we make the value of (cid:94) SegErr updatable, and update it to be (cid:94)
SegErr = w 1 (ˆ µ/ ˆ σ ) w 2 ˜ (cid:15) w 3 once a new segment is learned, where ˆ µ/ ˆ σ is the mean value of all the processed data so far.
This strategy enables us to promptly incorporate both the user preference and the data distribution into the calculation of (cid:94)
SegErr .
As for the optimization of the f ( (cid:15), µ, σ ) , we adopt the projected gradient descent (Calamai & Mor ´ e, 1987; den Hertog & Roos, 1991) with the parameter constraints in Eq.
In this way, we only need to track a few statistics and learn the (cid:15) estimator in an efﬁcient one-pass manner.
The overall adjustment algorithm is summarized in Appendix D.
E XPERIMENTS
E XPERIMENTAL S ETTINGS
Baselines.
We apply our framework into several SOTA (cid:15) -bounded learned index methods that use different mechanisms to determine the parameters of segments { S i } .
Among them, MET (Ferragina et al., 2020) ﬁxes the segment slope as the reciprocal of the expected key interval.
FITing-Tree (Galakatos et al., 2019) and Radix-Spline (Kipf et al., 2020) adopt a greedy shrinking cone algorithm and a spline interpolating algorithm respectively.
PGM (Ferragina & Vinciguerra, 2020b) adopts a convex hull based algorithm to achieve the minimum number of learned segments.
Further introduction and implementation details can be found in Appendix.
Datasets.
We use several widely adopted datasets with differing data scales and distributions (Kraska et al., 2018; Galakatos et al., 2019; Ferragina & Vinciguerra, 2020b;
Li et al., 2021).
Weblogs and IoT contain about 715M log entries from a university web server and 26M event entries from different IoT sensors respectively, in which the keys are both log timestamps.
Map dataset contains location coordinates that are collected around the world from the OpenStreetMap contributors (2017), and the keys are longitude + 90 · latitude of about 1.8M places.
Lognormal is a synthetic dataset whose key intervals follow the lognormal distribution.
We generate 20M keys with 40 partitions having different generation parameters to simulate the varied data characteristics among different localities.
More dataset details and visualization are presented in Appendix F.
Evaluation Metrics.
We evaluate the index performance in terms of its size, prediction preciseness, and the total querying time.
Speciﬁcally, we report the number of learned segments N , the index size in bytes, the MAE as 1 | D | (cid:80) ( x,y ) ∈ D | y − S ( x ) | , and the total querying time per query in ns ( i.e. , we perform querying operations for all the indexed data, record the total time of getting the payloads given the keys, and report the time that is averaged over all the queries).
For a quantitative comparison w.r.t.
the trade-off improvements, we calculate the area under the space-error curve (AUSEC) where the x-axis and y-axis indicate N and MAE respectively.
For AUSEC metric, the smaller, the better.
4. O VERALL I NDEX P ERFORMANCE
Space-Error Trade-off Improvements.
In Table 1, we summarize the AUSEC improvements in percentage brought by the proposed framework of all the baseline methods on all the datasets.
We also illustrate the space-error trade-off curves for some cases in Figure 2, where the blue curves indicate the results achieved by ﬁxed (cid:15) version while the red curves are for dynamic (cid:15) .
Other baselines and datasets yield similar curves, which we include in Appendix due to the space limitation.
From these results, we can see that the dynamic (cid:15) versions of all the baseline methods achieve much better error-space trade-off ( − 16 .
48% to − 23 .
57% averaged improvements as smaller AUSEC indicates better performance), demonstrating the effectiveness and the wide applicability of the proposed framework.
As discussed in previous sections, datasets usually have diverse key distributions at different data localities, and the proposed framework can data-dependently adjust (cid:15) to fully utilize the distribution information of data localities and thus achieve better index performance in terms of space-error trade-off.
Note that the Map dataset has signiﬁcant non-linearity caused by spatial characteristics, and it is hard to ﬁt using linear segments (all baseline methods learn linear segments), thus relatively small improvements are achieved
[Figure] [Table]
[Figure]
Querying Time Improvements.
Recall that the querying time of each data point is in O (log( N ) + log( | y − ˆ y | ) as we mentioned in Section 3.1, where N and | y − ˆ y | are inversely impacted by (cid:15) .
To examine whether the performance improvements w.r.t.
space-error trade-off ( i.e. , Table 1) can lead to better querying efﬁciency in real-world systems, we show the averaged total querying time per query and the actual learned index size in bytes for two scenarios in Figure 3.
We can observe that the dynamic (cid:15) versions indeed gain faster querying speed, since we improve both the term N as well as the term | y − ˆ y | via adaptive adjustment of (cid:15) .
The similar conclusion can be drawn from other baselines and datasets, and we present their results in Appendix.
Another thing to note is that, this experiment also veriﬁes the usability of our framework in which users can ﬂexibly set the expected ˜ (cid:15) to meet various space-time preferences just as they set (cid:15) in the original learned index methods.
Index Building Cost.
Comparing with the original learned index methods that adopt a ﬁxed (cid:15) , our framework introduces extra computation to dynamically adjust (cid:15) in the index building stage.
Does this affect the efﬁciency of original learned index methods?
Here we report the relative increments of building times in Table 2.
From it, we can observe that the proposed dynamic (cid:15) framework achieves comparable building times to all the original learned index methods on all the datasets, showing the efﬁciency of our framework since it has the same complexity as the original methods (both in O ( |D| ) ).
Also note that we only need to pay this extra cost once, i.e. , building the index once, and then the index structures can accelerate the frequent data querying operations for real-world applications.
[Table]
S TUDY OF D YNAMIC (cid:15)
To gain further insights about how the proposed dynamic (cid:15) framework works, we compare the proposed one with three dynamic (cid:15) variants: (1) Random (cid:15) is a vanilla version that randomly choose (cid:15) from [0 , 2˜ (cid:15) ] when learning each new segment; (2) Polynomial Learner differs our framework with another polynomial function SegErr ( (cid:15) )
= θ 1 (cid:15) θ 2 where θ 1 and θ 2 are trainable parameters; (3) Least
Square Learner differs our framework with an optimal (but very costly) strategy to learn f ( (cid:15), µ, σ ) with the least square regression.
[Table]
We summarize the AUSEC changes in percentage compared to the proposed framework in Table 3.
Here we only report the results for FITing-Tree due to the space limitation and similar results can be observed for other methods.
Recall that for AUSEC, the smaller, the better.
From this table, we have the following observations: (1) The Random (cid:15) version achieves much worse results than the proposed dynamic (cid:15) framework, showing the necessity and effectiveness of learning the impact of (cid:15) .
The Polynomial Learner achieves better results than the Random (cid:15) version while still have a large performance gap compared to our proposed framework.
This indicates the usefulness of the derived theoretical results that link the index performance, the (cid:15) and the data characteristics together.
(3) For the Least Square Learner , we can see that it achieves similar AUSEC results compared with the proposed framework.
However, it has higher computational complexity and pays the cost of much larger building times, e.g. , 14 × and 50 × longer building times on IoT and Map respectively.
These results demonstrate the effectiveness and efﬁciency of the proposed framework that adjusts (cid:15) based on the theoretical results, which will be validated next.
4. T HEORETICAL R ESULTS V ALIDATION
We study the impact of (cid:15) on SegErr i for the MET algorithm in Theorem 1, where the derivations are based on the setting of the slope condition a i = 1 /µ .
To conﬁrm that the proposed framework also works well with other (cid:15) -bounded learned index methods, we analyze the learned slopes of other (cid:15) -bounded methods in Appendix.
In summary, we prove that for a segment S i :
y = a i x + b i whose [Figure] [Figure] covered data is D i and the expected key interval of D
i is µ i , then a i concentrates on 1 /µ i within 2 (cid:15)/ ( E
[ Len ( D i )] − 1) relative deviations.
Here we plot the learned slopes of baseline learned index methods in Figure 4.
We can see that the learned slopes of other methods indeed center along the line {+a i = 
+}
/µ
i , showing the close connections among these methods and conﬁrming that the proposed framework can work well with other (cid:15) -bounded learned index methods.
We further compare the theoretical bounds with the actual SegErr i for all the adopted learned index methods.
In Figure 5, we only show the results on Lognormal dataset due to space limitation.
As expected, we can see that the MET method has the actual SegErr i within the derived bounds, verifying the correctness of the Theorem 1.
Besides, the other (cid:15) -bounded methods show the same trends with the MET method, providing the evidence that these methods have the same mathematical forms as we derived, and thus the (cid:15) -learner also works well with them.
4. C ASE S TUDY
IoT for FITing-Tree with ﬁxed (cid:15) = 32 and dynamic version ( ˜ (cid:15) = 32 ). We visualize the partial learned segments for FITing-Tree with ﬁxed and dynamic (cid:15) on IoT dataset in Figure 6, where the N and (cid:80)
SegErr i indicates the number of learned segments and the total prediction error for the shown segments respectively.
The −−→ µ/σ indicates the characteristics of covered data {D i } .
We can see that our dynamic framework helps the learned index gain both smaller space ( 7 v.s. 4 ) and smaller total prediction errors ( 48017 v.s. 29854 ).
Note that (cid:15) s within −→ (cid:15) i are diverse due to the diverse linearity of different data localities: For the data whose positions are within about [30000 , 30600] and [34700 , 35000] , the proposed framework chooses large (cid:15) s as their µ/σ s are small, and by doing so, it achieves smaller N than the ﬁxed version by absorbing these non-linear localities; For the data at the middle part, they have clear linearity with large µ/σ s, and thus the proposed framework adjusts (cid:15) as 19 and 10 that are smaller than 32 to achieve better precision.
These experimental observations are consistent with our analysis in the paragraph under Eq.
(2), and clearly conﬁrm that the proposed framework adaptively adjusts (cid:15) based on data characteristics.
C ONCLUSIONS
Existing learned index methods introduce an important hyper-parameter (cid:15) to provide a worst-case preciseness guarantee and meet various space-time user preferences.
In this paper, we provide formal analyses about the relationships among (cid:15) , data local characteristics and the introduced quantity
SegErr i for each learned segment, which is the product of the number of covered keys and MAE , and thus embeds the space-error trade-off.
Based on the derived mathematical relationships, we present a pluggable dynamic (cid:15) framework that leverages an (cid:15) -learner to data-dependently adjust (cid:15) and achieve better index performance in terms of space-error trade-off.
A series of experiments verify the effectiveness, efﬁciency and usability of the proposed framework.
We believe that our work contributes a deeper understanding of how the (cid:15) impacts the index performance, and enlightens the exploration of ﬁne-grained trade-off adjustments by considering data local characteristics.
Our study also opens several interesting future works.
For example, we can apply the proposed framework to other problems in which the piece-wise approximation algorithms with ﬁxed (cid:15) are used while still requiring space-error trade-off, such as similarity search and lossy compression for time series data (Chen et al., 2007;
Xie et al., 2014; Buragohain et al., 2007; O’Rourke, 1981).
R EPRODUCIBILITY S TATEMENT
For the Theorem 1 presented in Section 3.3, we give a complete proof in Appendix A.
We introduce more implementation details of our method and baselines in Appendix E. More detailed description of the adopted datasets is included in Appendix F. To facilitate the reproducibitlity, we share downloadable source codes and IPython notebooks, and attach binary ﬁles of the public experimental datasets in the anonymous link 2 .
A PPENDICES FOR THE S UBMISSION : L EARNED I NDEX WITH D YNAMIC (cid:15) A P ROOF OF T HEOREM
Given a learned segment S i :
y = a i x + b i , denote c i as the stored position of the last covered data for the ( i − 1) -th segment ( c 1 = 0 for the ﬁrst segment).
We can write the expectation of SegErr i for the segment S i as the following form:
[Equation]
where j ∗ indicates the length of the segment, and X j indicates the j -th key covered by the segment
S i .
As studied in Ferragina et al.
(2020), the linear-approximation problem with (cid:15) guarantee can be modeled as random walk processes.
Speciﬁcally, X j = X
+ (cid:80) jk
=
G k (for j ∈ Z > 0 )
where
G k is the key increment variable whose mean and variance is µ and σ 2 respectively.
Denote the
Z j = X j − j/a i + ( b i − c i − 1)
/a i as the j -th position of the transformed random walk { Z j } j ∈ N , and j ∗
= max { j ∈ N | − (cid:15)/a i ≤ Z j ≤ (cid:15)/a i } as the random variable indicating the maximal position when the random walk is within the strip of boundary ± (cid:15)/a i .
The expectation can be rewritten as
[Equation]
The last equality in Eq.
(3) is due to the deﬁnition of expectation.
Following the MET algorithm that the S i goes through the point ( X 0 , Y
=
c
i + 1) , we get b i = − a i X
+ c i +
and we can rewrite
Z j as the following form:
[Equation]
where W k is the walk increment variable of Z j , E
[ W k ] = µ − 1 /a
i and V ar [ W k ] = σ 2 .
Under the MET algorithm setting where a i = 1 /µ and ε (cid:29) σ/µ , the transformed random walk { Z j } has increments with zero mean and variance σ 2 , and many steps are necessary to reach the random walk boundary.
With the Central Limit Theorem, we can assume that Z j follows the normal distribution with mean µ zj and variance σ 2 zj , and thus | Z j | follows the folded normal distribution:
[Equation]
where Φ is the normal cumulative distribution function.
For the MET algorithm, a i = 1 /µ and thus the µ zj = 0 , σ zj = σ √ j , and E ( | Z j | ) =
(cid:112) 2 /πσ √ j .
Then the Eq.
(3) can be written as
[Equation]
j = | Z j | 
 Pr(
[Equation]
∗ = n
[Equation]
< 1 µ ∞ (cid:88) n = n − 1 (cid:88) j =
E [ | Z j | ]
Pr( j ∗ = n ) = σ µ (cid:114)π ∞ (cid:88) n = n − 1 (cid:88)
j = (cid:112) j Pr( j ∗ = n ) .
For the inner sum term in Eq.
(4), we have ( (cid:80) n − 1 j =0 √ j ) < 23 n √ n since n − 1 (cid:88)
j
= (cid:112)
j < n − 1 (cid:88)
j = (cid:112)
[Equation]
n
[Equation]
(cid:90) n
[Equation]
then the result in Eq.
(4) becomes
[Equation]
where the last inequality holds due to the Jensen inequality E [ X 34 ] ≤ ( E [ X ]) 34 .
Using E [ j ∗ ] = µ 2 σ 2 (cid:15)and V ar [ j ∗ ] = 2 3 µ 4 σ 4 (cid:15) 4 derived in MET algorithm Ferragina et al.
, we get E [( j ∗ ) 2 ] = 5 3 µ 4 σ 4 (cid:15) 4 , which yields the following upper bound:
[Equation]
For the lower bound, applying the triangle inequality into the Eq.
(3), we have
[Equation]
where Z = (cid:80) n − 1 j =
Z j .
Since Z j ∼ N (0 , σ 2 zj ) , the Z follows the normal distribution:
[Equation]
where r jk is the correlation between Z j and Z k .
Since µ Z = 0 , the | Z | follows the folded normal distribution with E [ | Z | ]
= σ Z (cid:112) 2 /π .
Since the random walk { Z j } is a process with i.i.d.
increments, the correlation r jk ≥ 0 .
With σ zj = σ √ j > 0 and r jk ≥ 0 , we have
[Equation]
and the result in Eq.
(5) becomes:
[Equation]
Since (cid:15) (cid:29) σµ , we can omit the right term (cid:113) 1 π σµ and ﬁnish the proof.
B L EARNED S LOPES OF O THER (cid:15) -B OUNDED M ETHODS
As shown in Theorem 1, we have known how (cid:15) impacts the SegErr i of each segment learned by the MET algorithm, where the theoretical derivations largely rely on the slope condition a i = 1 /µ .
Here we prove that for other (cid:15) -bounded methods, the learned slope of each segment ( i.e. , a i of S i ) concentrates on the reciprocal of the expected key interval as shown in the following Theorem.
Theorem 2.
Given an (cid:15) ∈ Z > 1 and an (cid:15) -bounded learned index algorithm A .
For a linear segment
S i : y = a i x + b i learned by A , denote its covered data and the number of covered keys as D i and Len ( D i ) respectively.
Assuming the expected key interval of D i is µ
i , the learned slope a
i concentrates on ˜ a = 1 /µ
i with bounded relative difference:
[Equation]
Proof.
For the learned linear segment S i , denote its ﬁrst predicted position and last predicted position as y (cid:48)
and y (cid:48) n respectively, we have its slope a
i = y (cid:48)
n − y (cid:48)
x n − x 0 .
Notice that y 0 − (cid:15) ≤ y (cid:48)
≤ y 0 + (cid:15) and y n − (cid:15) ≤ y (cid:48) n ≤ y n + (cid:15) due to the (cid:15) guarantee, we have y n − y
− 2 (cid:15) ≤ y (cid:48) n − y (cid:48)
≤ y n − y
+ 2 (cid:15) and the expectation of a i can be written as
[Equation]
Note that for any learned segment S i whose ﬁrst covered data is ( x 0 , y 0 ) and last covered data is ( x n , y n ), we have E [ x n − x 0 y n − y 0 ]
= µ i and thus the inequalities become
[Equation]
Since ˜ a = 1 /µ i and E [ x n − x 0 ] =
( E [ Len ( D i )] − 1) µ i , we ﬁnish the proof.
The Theorem 2 shows that the relative deviations between learned slope a i and ˜ a are within 2 (cid:15)/ ( E [ Len ( D i )] − 1) .
For the MET and PGM learned index methods, we have the following corollary that depicts preciser deviations without the expectation term
E
[ Len ( D i )] .
Corollary 2.1.
For the MET method Ferragina et al.
and the optimal (cid:15) -bounded linear approximation method that learns the largest segment length used in PGM Ferragina & Vinciguerra (2020b), the slope relative differences are at O (1 /(cid:15) ) .
Proof.
We note that the segment length of a learned segment is at O ( (cid:15) 2 ) for the MET algorithm, which is proved in the Theorem 1 of Ferragina et al.
Since PGM achieves the largest learned segment length that is larger than the one of the MET algorithm, we ﬁnish the proof.
C C ONNECTING P REDICTION E RROR WITH S EARCHING S TRATEGY
As we mentioned in Section 3.1, we can ﬁnd the true position of the queried data point in O (log( N )+ log( | ˆ y − y | )) where N is the number of learned segments and | ˆ y − y | is the absolute prediction error.
A binary search or exponential search can be used to ﬁnds the stored true position y based on ˆ y . It is worth noting out that the searching cost in terms of searching range | ˆ y − y | of binary search strategy corresponds to the maximum absolute prediction error (cid:15) , whereas the one of exponential search corresponds to the mean absolute prediction error ( MAE ). In this paper, we decouple the quantity SegErr i as the product of Len ( D i ) and MAE ( D i | S i ) in the derivation of Theorem 1.
Built upon the theoretical analysis, we adopt exponential search in experiments to better leverage the predictive models.
To clarify, let’s consider a learned segment S i with its covered data D i .
Denote the absolute prediction error of k -th data point covered by this segment as | ˆ y k − y k | , the maximum absolute prediction error as (cid:15) i where | ˆ y k − y k | ≤
(cid:15) i for all k ∈ [ len ( D i )]
• The binary search is conduct within the searching range [ ˆ y k ± (cid:15) i ] for each data 3 , thus the mean search range is (cid:80) k
=1 ,len ( D i ) 1 len
( D i ) 2 (cid:15)
i
=
O
( (cid:15) i ) , which is independent of the preciseness of the learned segment and an upper bound of MAE ( D i | S i ) .
• The exponential search ﬁrst ﬁnds the searching range where the queried data may present by centering around the ˆ y , repeatedly doubling the range [ ˆ y ± 2 q ] where the integer q grows from 0, and comparing the queried data with the data points at positions ˆ y ± 2 q .
After ﬁnding the speciﬁc range such that a q k satisﬁes 2 log( q k ) − 1 ≤ | ˆ y k − y k | ≤ 2 (cid:100) log( q k ) (cid:101) for the k -th data, an binary search is conducted to ﬁnd the its exact location.
In this way, the mean search range is (cid:80) k
=1 ,len ( D i ) 1 len
( D i ) (2 (cid:100) log( q k ) (cid:101) +1 )
=
O ( MAE ( D i | S i )) , which can be much smaller than O ( (cid:15) i ) especially for strong predictive models and the datasets having clear linearity.
D T HE A LGORITHM OF D YNAMIC (cid:15) A DJUSTMENT
Algorithm Dynamic (cid:15) Adjustment with Pluggable (cid:15) Learner
Input repeat 5:
6: (cid:15)
← (cid:16)
/w
[Table]
[Table]
) w
(cid:17)
/w/* adjust (cid:15) based on the learner */ 7: [ S i , D i ] ← A ( D , (cid:15) ∗ ) /* learn new segment S i using adjusted (cid:15) */ 8:
S ← S ∪ S
i 9:
D ← D \ D i , D S ← D S ∪ D
i 10:
Len ( D S ) ← running-mean (cid:0) Len ( D S ) ,
Len ( D i ) (cid:1) /
* online update Len ( D S ) */ 11: (ˆ µ/ ˆ σ ) ← running-mean (cid:0) (ˆ µ/ ˆ σ ) , ( µ/σ ) (cid:1) 12: w 1 , 2 , 3 ← optimize ( f, S i , SegErr i ) /* train the learner with ground-truth */ 13: (cid:94)
SegErr ← w 1 (ˆ µ/ ˆ σ ) w 2 ˜ (cid:15) w14: until D = ∅
In Section 3.4, we provide detailed description about the initialization and adjustment sub-procedures.
The lookahead () and optimize () are in the Look-ahead Data and (cid:94) SegErr and Optimization paragraph respectively.
E I MPLEMENTATION D ETAILS
All the experiments are conducted on a Linux server with an Intel Xeon Platinum 8163 2.50GHz
CPU.
We ﬁrst introduce more details and the implementation of baseline learned index methods.
MET (Ferragina et al., 2020) ﬁxes the segment slope as the reciprocal of the expected key interval, and goes through the ﬁrst available data point for each segment.
FITing-Tree (Galakatos et al., 2019) adopts a greedy shrinking cone algorithm and the learned segments are organized with a B + -tree.
Here we use the stx::btree (v0.9) implementation (Bingmann, 2013) and set the ﬁlling factors of inner nodes and leaf nodes as 100% , i.e. , we adopt the full-paged ﬁlling manner.
Radix-Spline (Kipf et al., 2020) adopts a greedy spline interpolating algorithm to learn spline points, and the learned spline segments are organized with a ﬂat radix table.
We set the number of radix bits as r = 16 for the Radix-Spline method, which means that the leveraged radix table contains 2 16 entries.
PGM (Ferragina & Vinciguerra, 2020b) adopts a convex hull based algorithm to achieve the minimum number of learned segments, and the segments can be organized with the help of binary search,
CSS-Tree (Rao & Ross, 1999) and recursive structure.
Here we implement the recursive version since it beats the other two variants in terms of indexing performance.
We then describe a few additional details of the proposed framework in terms of the (cid:15) -learner initialization and the hyper-parameter setting.
For the w 1 , 2 , 3 of the (cid:15) -learner shown in the Eq.
(2), at the beginning, we learn the ﬁrst ﬁve segments with the (cid:15) sequence [ 1 4 ˜ (cid:15), 1 2 ˜ (cid:15), ˜ (cid:15), 2˜ (cid:15), 4˜ (cid:15) ] , then track their rewarded SegErr i and update the parameters w 1 , 2 , 3 using least square regression.
We empirically found that this light-weight initialization leads to better index performance compared to the versions with random parameter initialization, and it beneﬁts the exploration of diverse (cid:15) ∗ , i.e. , leading to the larger variance of the dynamic (cid:15) sequence [ (cid:15) 1 , . . .
, (cid:15) i , . . .
, (cid:15) N ] .
As for the hyper-parameter ρ (described in the Section 3.4), we conduct grid search over ρ ∈ [0 . 1 , 0 . 4 , 0 .
on Map an IoT datasets.
We found that all the ρ s achieve better space-error trade-off ( i.e. , smaller AUSEC results) than the ﬁxed (cid:15) versions.
Since the setting ρ = 0 .
4 achieves averagely best results on the two datasets, we set ρ to be 0 .
4 for the other datasets.
F D ATASET D ETAILS
Our framework is veriﬁed on several widely adopted datasets having different data scales and distributions.
Weblogs Kraska et al.
; Galakatos et al.
; Ferragina & Vinciguerra (2020b) contains about 715M log entries for the requests to a university web server and the keys are log timestamps.
IoT Galakatos et al.
; Ferragina & Vinciguerra (2020b) contains about 26M event entries from different IoT sensors in a building and the keys are recording timestamps.
Map dataset
Kraska et al.
; Galakatos et al.
; Ding et al.
; Ferragina & Vinciguerra (2020b); Li et al.
(2021) contains location coordinates of 1.8M places that are collected around the world from the Open Street Map OpenStreetMap contributors (2017), and the keys are compound by coordinates as longitude + 90 · latitude .
Lognormal Ferragina & Vinciguerra (2020b) is a synthetic dataset whose key intervals follow the lognormal distribution: ln ( G i ) ∼ N ( µ lg , σ 2 lg ) .
To simulate the varied data characteristics among different localities.
We generate 20M keys with 40 partitions by setting µ lg = 1 and setting σ lg with a random number within [0 . 1 , 1] for each partition [Figure]
We normalize the positions of stored data into the range [0 , 1] [Figure] and thus the key-position distribution can be modeled as Cumulative Distribution Function (CDF).
We plot the CDFs and zoomed-in CDFs of experimental datasets in Figure 7 and Figure 8 respectively
[Figure]
which intuitively illustrate the diversity of the adopted datasets. [Figure]
[Figure] G A DDITIONAL E XPERIMENTAL R ESULTS
Overall Index Performance.
For the space-error trade-off improvements and the actual querying efﬁciency improvements brought by the proposed framework, we illustrate more space-error tradeoff curves in Figure 9 and querying time results in Figure 10.
Recall that the N - MAE trade-off curve adequately reﬂects the index size and querying time : (1) the segment size in bytes and N are only different by a constant factor, e.g., the size of a segment can be 128bit if it consists of two double-precision ﬂoat parameters (slope and intercept); (2) the querying operation can be done in
O ( log ( N ) + log ( | y − ˆ y | ) as we mentioned in Section 3.1, thus a better N - MAE trade-off indicates a better querying efﬁciency.
From these ﬁgures, we can see that the dynamic (cid:15) versions of all the baseline methods achieve better space-error trade-off and better querying efﬁciency, verifying the effectiveness and the wide applicability of the proposed framework.
Ablation Study.
To examine the necessity and the effectiveness of the proposed framework, in
Section 4.3, we compare the proposed framework with three dynamic (cid:15) variants for the FITing-Tree method.
Here we demonstrate the AUSEC relative changes for the Radix-Spline method with the same three variants in Table 4 and similar conclusions can be drawn.
[Table]
Theoretical Validation.
In Section 4.4, we show that all the learned index baseline methods learn similar segment slopes on the Map dataset.
Here we illustrate the learned slope results on the IoT,
Weblogs and Lognormal datasets in Figure 11, which supports the Theorem 2 that the learned segment slopes concentrate on the 1 /µ i with a bounded relative difference.
Besides, for the comparison between the theoretical bounds and the actual SegErr i of all the adopted learned index methods [Figure] we show more results on another two datasets Gamma and Uniform in Figure 12, where the key intervals of the two datasets follow gamma distribution and uniform distribution respectively.
These results show that the MET method gains actual SegErr i within the bounds, verifying the correctness of the Theorem 1 again.
Here all the learned index methods also achieve the same trends, showing that these methods have the same mathematical forms w.r
[Figure]
t. the SegErr i , (cid:15) and µ/σ
[Figure]
and hence the (cid:15) -learner can effectively learn the estimator and adaptively choose suitable (cid:15)
[Figure]
[Figure] [Figure]