<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Big Data</journal-id>
<journal-title>Frontiers in Big Data</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Big Data</abbrev-journal-title>
<issn pub-type="epub">2624-909X</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fdata.2020.00028</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Big Data</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>R*-Grove: Balanced Spatial Partitioning for Large-Scale Datasets</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name><surname>Vu</surname> <given-names>Tin</given-names></name>
<uri xlink:href="http://loop.frontiersin.org/people/833538/overview"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Eldawy</surname> <given-names>Ahmed</given-names></name>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/746374/overview"/>
</contrib>
</contrib-group>
<aff><institution>Department of Computer Science and Engineering, University of California, Riverside</institution>, <addr-line>Riverside, CA</addr-line>, <country>United States</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Liyue Fan, University at Albany, United States</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Keke Chen, Wright State University, United States; Arnab Bhattacharya, Indian Institute of Technology Kanpur, India; Jia Yu, Arizona State University, United States</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Ahmed Eldawy <email>eldawy&#x00040;ucr.edu</email></corresp>
<fn fn-type="other" id="fn001"><p>This article was submitted to Data Mining and Management, a section of the journal Frontiers in Big Data</p></fn></author-notes>
<pub-date pub-type="epub">
<day>28</day>
<month>08</month>
<year>2020</year>
</pub-date>
<pub-date pub-type="collection">
<year>2020</year>
</pub-date>
<volume>3</volume>
<elocation-id>28</elocation-id>
<history>
<date date-type="received">
<day>25</day>
<month>12</month>
<year>2019</year>
</date>
<date date-type="accepted">
<day>24</day>
<month>07</month>
<year>2020</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2020 Vu and Eldawy.</copyright-statement>
<copyright-year>2020</copyright-year>
<copyright-holder>Vu and Eldawy</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract><p>The rapid growth of big spatial data urged the research community to develop several big spatial data systems. Regardless of their architecture, one of the fundamental requirements of all these systems is to spatially partition the data efficiently across machines. The core challenges of big spatial partitioning are building high spatial quality partitions while simultaneously taking advantages of distributed processing models by providing load balanced partitions. Previous works on big spatial partitioning are to reuse existing index search trees as-is, e.g., the R-tree family, STR, Kd-tree, and Quad-tree, by building a temporary tree for a sample of the input and use its leaf nodes as partition boundaries. However, we show in this paper that none of those techniques has addressed the mentioned challenges completely. This paper proposes a novel partitioning method, termed R*-Grove, which can partition very large spatial datasets into high quality partitions with excellent load balance and block utilization. This appealing property allows R*-Grove to outperform existing techniques in spatial query processing. R*-Grove can be easily integrated into any big data platforms such as Apache Spark or Apache Hadoop. Our experiments show that R*-Grove outperforms the existing partitioning techniques for big spatial data systems. With all the proposed work publicly available as open source, we envision that R*-Grove will be adopted by the community to better serve big spatial data research.</p></abstract>
<kwd-group>
<kwd>big spatial data</kwd>
<kwd>partitioning</kwd>
<kwd>R*-Grove</kwd>
<kwd>index optimization</kwd>
<kwd>query processing</kwd>
</kwd-group>
<contract-num rid="cn001">CNS-1924694</contract-num>
<contract-num rid="cn001">IIS-1838222</contract-num>
<contract-sponsor id="cn001">National Science Foundation<named-content content-type="fundref-id">10.13039/100000001</named-content></contract-sponsor>
<counts>
<fig-count count="14"/>
<table-count count="1"/>
<equation-count count="22"/>
<ref-count count="42"/>
<page-count count="19"/>
<word-count count="13060"/>
</counts>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>1. Introduction</title>
<p>The recent few years witnessed a rapid growth of big spatial data collected by different applications such as satellite imagery (Eldawy et al., <xref ref-type="bibr" rid="B13">2015b</xref>), social networks (Magdy et al., <xref ref-type="bibr" rid="B29">2014</xref>), smart phones (Henke et al., <xref ref-type="bibr" rid="B19">2016</xref>), and VGI (Goodchild, <xref ref-type="bibr" rid="B17">2007</xref>). Traditional Spatial DBMS technology could not scale up to these petabytes of data which led to the birth of many big spatial data management systems such as SpatialHadoop (Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>), GeoSpark (Yu et al., <xref ref-type="bibr" rid="B41">2015</xref>), Simba (Xie et al., <xref ref-type="bibr" rid="B40">2016</xref>), LocationSpark (Tang et al., <xref ref-type="bibr" rid="B34">2016</xref>), and Sphinx (Eldawy et al., <xref ref-type="bibr" rid="B8">2017</xref>), to name a few.</p>
<p>Regardless of their architecture, all these systems need an essential preliminary step that partitions the data across machines before the execution can be parallelized. This is also known as <italic>global indexing</italic> (Eldawy and Mokbel, <xref ref-type="bibr" rid="B12">2016</xref>). A common method that was first introduced in SpatialHadoop (Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>), is the sample-based STR partitioner. This method picks a small sample of the input to determine its distribution, packs this sample using the STR packing algorithm (Leutenegger et al., <xref ref-type="bibr" rid="B25">1997</xref>), and then uses the boundaries of the leaf nodes to partition the entire data. <xref ref-type="fig" rid="F1">Figure 1A</xref> shows an example of an STR-based partitioning where each data partition is depicted by a rectangle. The method was later generalized by replacing the STR bulk loading algorithm with other spatial indexes such as Quad-tree (Samet, <xref ref-type="bibr" rid="B32">1984</xref>), Kd-Tree, and Hilbert R-trees (Kamel and Faloutsos, <xref ref-type="bibr" rid="B22">1994</xref>; Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>). That STR-based partitioning was very attractive due to its simplicity and good load balancing which is very important for distributed applications. Its simplicity urged many other researchers to adopt it in their systems such as GeoSpark (Yu et al., <xref ref-type="bibr" rid="B41">2015</xref>) and Simba (Xie et al., <xref ref-type="bibr" rid="B40">2016</xref>) for in-memory distributed processing; Sphinx (Eldawy et al., <xref ref-type="bibr" rid="B8">2017</xref>) for SQL big spatial data processing; HadoopViz (Eldawy et al., <xref ref-type="bibr" rid="B14">2016</xref>; Ghosh et al., <xref ref-type="bibr" rid="B16">2019</xref>) for scalable visualization of big spatial data; and in distributed spatial join (Sabek and Mokbel, <xref ref-type="bibr" rid="B31">2017</xref>).</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>Comparison between STR and R*-Grove. <bold>(A)</bold> STR-based partitioning (Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>). All the thin and wide partitions reduce the query efficiency. <bold>(B)</bold> The proposed R*-Grove method with square-like and balanced partitions.</p></caption>
<graphic xlink:href="fdata-03-00028-g0001.tif"/>
</fig>
<p>Despite their wide use, the existing partitioning techniques all suffer from one or more of the following three limitations. First, some partitioning techniques (STR, Kd-tree) prioritize load balance over spatial quality which results in suboptimal partitions. This is apparent in <xref ref-type="fig" rid="F1">Figure 1A</xref> where the thin and wide partitions result in low overall quality for the partitions since square-like partitions are preferred for most spatial queries. Square-like partitions are preferred in indexing because they indicate that the index is not biased toward one dimension. Also, since most queries are shaped like a square or a circle, square-like partitions would minimize the overlap with the queries (Beckmann et al., <xref ref-type="bibr" rid="B2">1990</xref>). Second, they could produce partitions that do not fill the HDFS blocks in which they are stored. Big data systems are optimized to process full blocks, i.e., 128 MB, to offset the fixed overhead in processing each block. However, the index structures used in existing partitioning techniques, e.g., R-trees, Kd-tree, Quad-tree, produce nodes with number of records in the range [<italic>m, M</italic>], where <italic>m</italic> &#x02264; <italic>M</italic>/2. In practice, <italic>m</italic> can be as low as 0.2<italic>M</italic> (Beckmann et al., <xref ref-type="bibr" rid="B2">1990</xref>; Beckmann and Seeger, <xref ref-type="bibr" rid="B4">2009</xref>). While those underutilized index nodes were desirable for disk indexing as they can accommodate future inserts, they result in underutilized blocks as depicted in <xref ref-type="fig" rid="F1">Figure 1A</xref> where all blocks are &#x0003C;80% full. Moreover, this design might also produces poor load balance among partitions due to the wide range of partition sizes. Third, all existing partitioning techniques rely on a sample and try to balance the number of records per partition. This resembles traditional indexes where the index contains record IDs. However, in big spatial data partitioning, the entire record is written in each partition, not just its ID. When records are highly variant in size, all existing techniques end up with extremely unbalanced partitions.</p>
<p>This paper proposes a novel spatial partitioning technique for big data, termed R*-Grove, which completely addresses all of three aforementioned limitations. First, it produces high quality partitions by utilizing the R*-tree optimization techniques (Beckmann et al., <xref ref-type="bibr" rid="B2">1990</xref>) which aim at minimizing the total area, overlap area, and margins. The key idea of the R*-Grove partitioning technique is to start with one partition that contains all sample points and then use the node split algorithm of the R*-tree to split it into smaller partitions. This results in compact square-like partitions as shown in <xref ref-type="fig" rid="F1">Figure 1B</xref>. Second, in order to ensure that we produce full blocks and balanced partitions, R*-Grove introduces a new constraint that puts a lower bound on the ratio between the smallest and the largest block, e.g., 95%. This property is theoretically proven and practically validated by our experiments. Third, when the input records have variable sizes, R*-Grove combines a data size histogram with the sample points to assign a weight for each sample point. These weights are utilized to guarantee that the size of each partition falls in a user-defined range.</p>
<p>Given the wide adoption of the previous STR-based partitioner, we believe the proposed R*-Grove will be widely used in big spatial data systems. This impacts a wide range of spatial analytics and processing algorithms including indexing (Vo et al., <xref ref-type="bibr" rid="B36">2014</xref>; Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>), range queries (Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>; Yu et al., <xref ref-type="bibr" rid="B41">2015</xref>), kNN queries (Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>), visualization (Eldawy et al., <xref ref-type="bibr" rid="B14">2016</xref>; Ghosh et al., <xref ref-type="bibr" rid="B16">2019</xref>), spatial join (Jacox and Samet, <xref ref-type="bibr" rid="B21">2007</xref>), and computational geometry (Eldawy et al., <xref ref-type="bibr" rid="B10">2013</xref>; Li et al., <xref ref-type="bibr" rid="B26">2019</xref>). All the work proposed in this paper is publicly available as open source and supports both Apache Spark and Apache Hadoop. We run an extensive experimental evaluation with up-to 500 GB and 7 billion record datasets and up-to nine dimensions. The experiments show that R*-Grove consistently outperforms existing STR-based, Z-curve-based, Hilbert-Curve-based, and Kd-tree-based techniques in both partitions quality and query efficiency.</p>
<p>The rest of this paper is organized as follow. Section 2 describes the related works. Section 3 gives a background about big spatial data partitioning. Section 4 describes the proposed R*-Grove technique. Section 5 describes the advantages of R*-Grove in popular case studies of big spatial data systems. Section 6 gives a comprehensive experimental evaluation of the proposed work. Finally, section 7 concludes the paper.</p></sec>
<sec id="s2">
<title>2. Related Work</title>
<p>This section discusses the related work in big spatial data partitioning. In general, distributed indexes for big spatial data are constructed in two levels, one global index that partitions the data across machines, and several local indexes that organize records in each partition. Previous work (Lu et al., <xref ref-type="bibr" rid="B28">2014</xref>; Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>, <xref ref-type="bibr" rid="B12">2016</xref>) showed that the global index provides far much improvement than local indexes. Therefore, in this paper we focus on global indexing and it can be easily combined with any of the existing local indexes. The work in global indexing can be broadly categorized into three approaches, namely, sampling-based methods, space-filling-curve (SFC)-based methods, and quad-tree-based methods.</p>
<p>The <italic>sampling-based</italic> method picks a small sample from the input data to infer its distribution. The sample is loaded into an in-memory index structure while adjusting the data page capacity, e.g., leaf node capacity, such that the number of data pages is roughly equal to the desired number of partitions. The order of sample objects does not affect the partition quality, since the sample is uniformly taken from the entire input dataset. Furthermore, most of algorithms sort the data as part of the partitioning process so the original order is completely lost. Some R-tree bulk-loading algorithms (STR Leutenegger et al., <xref ref-type="bibr" rid="B25">1997</xref> or OMT Lee and Lee, <xref ref-type="bibr" rid="B24">2003</xref>) can also be used to speed up the tree construction time. Then, the minimum bounding rectangles (MBRs) of the data pages are used to partition the entire dataset. This method was originally proposed for spatial join and denoted the seeded-tree (Lo and Ravishankar, <xref ref-type="bibr" rid="B27">1994</xref>). It was then used for big spatial indexing in many systems including SpatialHadoop (Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>; Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>), Scala-GiST (Lu et al., <xref ref-type="bibr" rid="B28">2014</xref>), GeoSpark (Yu et al., <xref ref-type="bibr" rid="B41">2015</xref>), Sphinx (Eldawy et al., <xref ref-type="bibr" rid="B8">2017</xref>), Simba (Xie et al., <xref ref-type="bibr" rid="B40">2016</xref>), and many other systems. This technique can be used with existing R-tree indexes but it suffers from two limitations, load imbalance and low quality of spatial partitions. Additionally, when there is a big variance in record sizes, the load imbalance is further amplified due to the use of the sample. We will further discuss these limitations in section 4.</p>
<p>The <italic>SFC-based</italic> method builds a spatial index on top of an existing one-dimensional index by applying any space-filling curve, e.g., Z-curve or Hilbert curve. MD-HBase (Nishimura et al., <xref ref-type="bibr" rid="B30">2013</xref>) builds Kd-tree-like and Quad-tree-like indexes on top of HBase by applying the Z-curve on the input data and customizing the region split method in HBase to respect the structure of both indexes. GeoMesa (Fox et al., <xref ref-type="bibr" rid="B15">2013</xref>) uses geo-hashing which is also based on the Z-curve to build spatio-temporal indexes on top of Accumulo. Unlike MD-HBase which only supports point data, GeoMesa can support rectangular of polygonal geometries by replicating a record to all overlapping buckets in the geohash. While this method can ensure a near-perfect load balance, it produces an even bigger spatial overlap between partitions as compared to the sampling-based approach described above. This drawback leads to the inefficient performance of spatial queries.</p>
<p>The <italic>quad-tree-based</italic> method relies heavily on the Quad-tree structure to build efficient and scalable Quad-tree index in Hadoop (Whitman et al., <xref ref-type="bibr" rid="B39">2014</xref>). It starts by splitting the input data into equi-sized chunks and building a partial Quad-tree for each split. Then, it combines the leaf nodes of the partial trees based on the Quad-tree structure to merge them into the final tree. While highly efficient, this method cannot generalize to other spatial indexes and is tightly tied to the Quad-tree structure. In addition, this Quad-tree-based partitioning tends to produce much more than the desired number of partitions which also leads to load imbalance.</p>
<p>Although there are several partitioning techniques for large-scale spatial data as mentioned above, sampling-based method is the most ubiquitous option, which is integrated in most of existing spatial data systems. Sampling-based methods are preferred as they are simple to implement and provide very good results. In this paper, we follow the sampling-based approach, and propose a method which utilizes R*-tree&#x00027;s advantages that were never used before for big spatial data partitioning. The proposed R*-Grove index has three advantages over the existing work. First, it inherits and improves the R*-tree index structure to produce high-quality partitions that are tailored to big spatial data. Second, the improved algorithm produces balanced partitions by employing a user-defined parameter, termed <italic>balance factor</italic>, &#x003B1;, e.g., 95%. In addition, it can produce spatially disjoint partitions which are necessary for some spatial analysis algorithms. Third, R*-Grove can couple a sample with a data size histogram to guarantee the desired load balance even when the input record sizes are highly variant. While R*-Grove is not the only framework for big spatial partitioning, it is the first one that is tailored for large-scale spatial datasets while existing techniques reuse traditional index structures, such as R-tree, STR, or Quad-tree, as black boxes.</p></sec>
<sec id="s3">
<title>3. Background</title>
<sec>
<title>3.1. R*-Tree</title>
<p>The R*-tree (Beckmann et al., <xref ref-type="bibr" rid="B2">1990</xref>) belongs to the R-tree family (Guttman, <xref ref-type="bibr" rid="B18">1984</xref>) and it improves the insertion algorithm to provide high quality index. In R-tree, the number of children in each nodes has to be in the range [<italic>m, M</italic>]. By design, <italic>m</italic> can be at most &#x0230A;<italic>M</italic>/2&#x0230B; to ensure that splitting a node of size <italic>M</italic> &#x0002B; 1 is feasible. In this paper, we utilize and enhance two main functions of the R*-tree index, namely, <sc>ChooseSubtree</sc> and <sc>SplitNode</sc> which are both used in the insertion process. For the <sc>ChooseSubtree</sc> method, given the MBR of a record and a tree node, it chooses the best subtree to assign this record to. The <sc>SplitNode</sc> method takes an overflow node with <italic>M</italic> &#x0002B; 1 records and splits it into two nodes.</p></sec>
<sec>
<title>3.2. Sample-Based Partitioning Workflow</title>
<p>This section gives a background on the sampling-based partitioning technique (Vo et al., <xref ref-type="bibr" rid="B36">2014</xref>; Eldawy and Mokbel, <xref ref-type="bibr" rid="B11">2015</xref>; Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>), just partitioning hereafter, that this paper relies on. <xref ref-type="fig" rid="F2">Figure 2</xref> shows the workflow for the partitioning algorithm which consists of three phases, namely, sampling, boundary computation, and partitioning. The sampling phase (Phase 1) draws a random sample of the input records and converts each one to a point. Notice that sample points are picked from the entire file at no particular order so the order of points does not affect the next steps. The boundary computation phase (Phase 2) runs on a single machine and processes the sample to produce partition boundaries as a set of rectangles. Given a sample <italic>S</italic>, the input size <italic>D</italic>, and the desired partition size <italic>B</italic>, this phase adjusts the capacity of each partition to contain <italic>M</italic> &#x0003D; &#x02308;|<italic>S</italic>|&#x000B7;<italic>B</italic>/<italic>D</italic>&#x02309; sample points which is expected to produce final partitions with the size of one block each. The final partitioning phase (Phase 3) scans the entire input in parallel and assigns each record to these partitions based on the MBR of the record and the partition boundaries. If each record is assigned to exactly one partition, the partitions will be spatially overlapping with no data replication. If each record is assigned to all overlapping partitions, the partitions will be spatially disjoint but some records can be replicated and duplicate handling will be needed in the query processing (Dittrich and Seeger, <xref ref-type="bibr" rid="B7">2000</xref>). Some algorithms can only work if the partitions are spatially disjoint such as visualization (Eldawy et al., <xref ref-type="bibr" rid="B14">2016</xref>) and some computational geometry functions (Li et al., <xref ref-type="bibr" rid="B26">2019</xref>).</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>The sampling-based partitioning process.</p></caption>
<graphic xlink:href="fdata-03-00028-g0002.tif"/>
</fig>
<p>The proposed R*-Grove method expands Phase 1 by optionally building a histogram of storage size that assists in the partitioning algorithm at Phase 2. In Phase 2, it adapts R*-tree-based algorithms to produce the partition boundaries with desired level of load balance. In Phase 3, we propose a new data structure that improves the performance of that phase and allows us to produce spatially disjoint partitions if needed.</p></sec>
<sec>
<title>3.3. Quality Metrics</title>
<p>This paper uses the quality metrics defined in Eldawy et al. (<xref ref-type="bibr" rid="B9">2015a</xref>). Below, we redefine these metrics while accounting for the case of partitions that span multiple HDFS blocks. A single partition &#x003C0;<sub><italic>i</italic></sub> is defined by two parameters, minimum bounding box <italic>mbb</italic><sub><italic>i</italic></sub> and size in bytes <italic>size</italic><sub><italic>i</italic></sub>. Given the HDFS block size <italic>B</italic>, e.g., 128 MB, we define the number of blocks for a partition &#x003C0;<sub><italic>i</italic></sub> as <italic>b</italic><sub><italic>i</italic></sub> &#x0003D; &#x02308;<italic>size</italic><sub><italic>i</italic></sub>/<italic>B</italic>&#x02309;. Given a dataset that is partitioned into a set of <italic>l</italic> partitions, <inline-formula><mml:math id="M1"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:math></inline-formula>, we define the five quality metrics as follows.</p>
<p><sc>Definition 1</sc> (Total Volume - <italic>Q</italic><sub>1</sub>). <italic>The total volume is the sum of the volume of all partitions where the volume of a partition is the product of its side lengths</italic>.
<disp-formula id="E1"><mml:math id="M2"><mml:mrow><mml:msub><mml:mrow><mml:mi>Q</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x000B7;</mml:mo><mml:mi>v</mml:mi><mml:mi>o</mml:mi><mml:mi>l</mml:mi><mml:mi>u</mml:mi><mml:mi>m</mml:mi><mml:mi>e</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:mi>b</mml:mi><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:math></disp-formula></p>
<p><italic>We multiply by the number of blocks</italic> <italic>b</italic><sub><italic>i</italic></sub> <italic>because big spatial data systems process each block separately. Lowering the total volume is preferred to minimize the overlap with a query. Given the popularity of the two-dimensional case, this is usually used under the term total area</italic>.</p>
<p><sc>Definition 2</sc> (Total Volume Overlap - <italic>Q</italic><sub>2</sub>). <italic>This quality metric measures the sum of the overlap between pairs of partitions</italic>.</p>
<disp-formula id="E2"><mml:math id="M3"><mml:mtable columnalign='left'><mml:mtr><mml:mtd><mml:msub><mml:mi>Q</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo stretchy='false'>(</mml:mo><mml:mi mathvariant="-tex-caligraphic">P</mml:mi><mml:mo stretchy='false'>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle='true'><mml:munder><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:msub><mml:mi>&#x003C0;</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>&#x003C0;</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:munder><mml:mrow><mml:msub><mml:mi>b</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x000B7;</mml:mo><mml:msub><mml:mi>b</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>&#x000B7;</mml:mo><mml:mi>v</mml:mi><mml:mi>o</mml:mi><mml:mi>l</mml:mi><mml:mi>u</mml:mi><mml:mi>m</mml:mi><mml:mi>e</mml:mi><mml:mo stretchy='false'>(</mml:mo><mml:mi>m</mml:mi><mml:mi>b</mml:mi><mml:msub><mml:mi>b</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02229;</mml:mo><mml:mi>m</mml:mi><mml:mi>b</mml:mi><mml:msub><mml:mi>b</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo stretchy='false'>)</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtext>&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;&#x02009;</mml:mtext><mml:mo>+</mml:mo><mml:mstyle displaystyle='true'><mml:munder><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:msub><mml:mi>&#x003C0;</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:munder><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mi>b</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy='false'>(</mml:mo><mml:msub><mml:mi>b</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy='false'>)</mml:mo></mml:mrow><mml:mn>2</mml:mn></mml:mfrac><mml:mo>&#x000B7;</mml:mo><mml:mi>v</mml:mi><mml:mi>o</mml:mi><mml:mi>l</mml:mi><mml:mi>u</mml:mi><mml:mi>m</mml:mi><mml:mi>e</mml:mi><mml:mo stretchy='false'>(</mml:mo><mml:mi>m</mml:mi><mml:mi>b</mml:mi><mml:msub><mml:mi>b</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy='false'>)</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><italic>where</italic> <italic>mbb</italic><sub><italic>i</italic></sub>&#x02229;<italic>mbb</italic><sub><italic>j</italic></sub> <italic>is the intersection region between the two boxes. The first term calculates the overlaps between pairs of partitions and the second term accounts for self-overlap which treats a partition with multiple blocks as overlapping partitions. Lowering the volume overlap is preferred to keep the partitions apart</italic>.</p>
<p><sc>Definition 3</sc> (Total Margin - <italic>Q</italic><sub>3</sub>). The margin of a block is the sum of its side lengths. The total margin is the sum of all margins as given below.</p>
<disp-formula id="E4"><mml:math id="M5"><mml:mrow><mml:msub><mml:mrow><mml:mi>Q</mml:mi></mml:mrow><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mi>a</mml:mi><mml:mi>r</mml:mi><mml:mi>g</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:mi>b</mml:mi><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:math></disp-formula>
<p>Similar to <italic>Q</italic><sub>1</sub>, multiplying by the number of blocks <italic>b</italic><sub><italic>i</italic></sub> treats each block as a separate partition. Lowering the total margin is preferred to produce square-like partitions.</p>
<p><sc>Definition 4</sc> (Block Utilization - <italic>Q</italic><sub>4</sub>). <italic>Block utilization measures how full the HDFS blocks are</italic>.</p>
<disp-formula id="E5"><mml:math id="M6"><mml:mrow><mml:msub><mml:mrow><mml:mi>Q</mml:mi></mml:mrow><mml:mrow><mml:mn>4</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow></mml:msub></mml:mstyle><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>z</mml:mi><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>B</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow></mml:msub></mml:mstyle><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<p><italic>The numerator</italic> &#x02211;<italic>size</italic><sub><italic>i</italic></sub> <italic>represents the total size of all partitions and denominator</italic> <italic>B</italic>&#x02211;<italic>b</italic><sub><italic>i</italic></sub> <italic>is the maximum amount of data that can be stored in all blocks used by these partitions. In big data applications, each block is processed in a separate task which has a setup time of a few seconds. Having full or near-full blocks minimize the overhead of the setup. The maximum value of block utilization is</italic> 1.0<italic>, or</italic> 100%.</p>
<p><sc>Definition 5</sc> (Standard Deviation of Sizes).</p>
<disp-formula id="E6"><mml:math id="M7"><mml:mrow><mml:msub><mml:mrow><mml:mi>Q</mml:mi></mml:mrow><mml:mrow><mml:mn>5</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:mfrac><mml:mrow><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003C0;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">P</mml:mi></mml:mrow></mml:mrow></mml:msub></mml:mstyle><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>z</mml:mi><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>z</mml:mi><mml:mi>e</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mi>l</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:msqrt></mml:mrow></mml:math></disp-formula>
<p><italic>Where</italic> <inline-formula><mml:math id="M8"><mml:mover accent="false" class="mml-overline"><mml:mrow><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>z</mml:mi><mml:mi>e</mml:mi></mml:mrow><mml:mo accent="true">&#x000AF;</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mo>&#x02211;</mml:mo><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>z</mml:mi><mml:msub><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>l</mml:mi></mml:math></inline-formula> <italic>is the average partition size. Lowering this value is preferred to balance the load across partitions</italic>.</p></sec></sec>
<sec id="s4">
<title>4. R*-Grove Partitioning</title>
<p>This section describes the details of the proposed R*-Grove partitioning algorithm. R*-Grove employs three techniques that overcome the limitations of existing works. The first technique adapts the R*-tree index structure for spatial partitioning by utilizing the <sc>ChooseSubTree</sc> and <sc>SplitNode</sc> functions in the sample-based approach described in section 3. This technique ensures a high spatial quality of partitions. The second technique addresses the problem of load balancing by introducing a new constraint that guarantees a user-defined ratio between smallest and largest partitions. The third technique combines the sample points with its storage histogram to balance the sizes of the partitions rather than the number of records. This combination allows R*-Grove to precisely produce partitions with a desired block utilization, which cannot be achieved by any other partitioning techniques.</p>
<sec>
<title>4.1. R*-Tree-Based Partitioning</title>
<p>This part describes how R*-Grove utilizes the R*-tree index structure to produce high quality partitions. It utilizes the <sc>SplitNode</sc> and <sc>ChooseSubtree</sc> functions from the R*-tree algorithm in Phases 2 and 3 as described shortly. A na&#x000EF;ve method (Vu and Eldawy, <xref ref-type="bibr" rid="B37">2018</xref>) is to use the R*-tree as a blackbox in Phase 2 in <xref ref-type="fig" rid="F2">Figure 2</xref> and insert all the sample points into an R*-tree. Then it emits the MBRs of the leaf nodes as the output partition boundaries. However, this technique was shown to be inefficient as it processes the sample points one-by-one and does not integrate the R*-tree index well in the partitioning algorithm. Therefore, we propose an efficient approach that runs much faster and produces higher quality partitions. It extends Phases 2 and 3 as follows.</p>
<p>Phase 2 computes partition boundaries by only using the <sc>SplitNode</sc> algorithm from the R*-tree index which splits a node with <italic>M</italic> &#x0002B; 1 records into two nodes with the size of each one in the range [<italic>m, M</italic>]. This algorithm starts by choosing the split axis, e.g., <italic>x</italic> or <italic>y</italic>, that minimizes the total margin. Then, all the points are sorted along the chosen axis and the split point is chosen as depicted in Algorithm 1. The <sc>ChooseSplitPoint</sc> algorithm simply considers all the split points and chooses the one that minimizes some cost function which is typically the total area of the two resulting partitions.</p>
<table-wrap position="float">
<label>Algorithm 1</label>
<caption><p>A simplified version of the traditional R*-tree splitting mechanism.</p>
<p>Inputs: <italic>P</italic> is the all sample records; <italic>m</italic> is the minimum size of a node.</p>
<p>Output: the optimal splitting position.</p></caption>
<table frame="hsides" rules="groups">
<tbody>
<tr>
<td align="left" valign="top"><sc>1</sc>:&#x000A0;<bold>function</bold> <sc>ChooseSplitPoint</sc>(<italic>P</italic>,<italic>m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top"><sc>2</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;chosenK &#x0003D; &#x02212;1; minCost &#x0003D; &#x0221E;</td>
</tr>
<tr>
<td align="left" valign="top"><sc>3</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>k</italic> in [<italic>m</italic>, |<italic>P</italic>| &#x02212; <italic>m</italic>] <bold>do</bold></td>
</tr>
<tr>
<td align="left" valign="top"><sc>4</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>P</italic><sub>1</sub> &#x0003D; <italic>P</italic>[1..<italic>k</italic>]&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x022B3; <italic>P</italic><sub>1</sub> is the first <italic>k</italic> records of <italic>P</italic>
</td>
</tr>
<tr>
<td align="left" valign="top"><sc>5</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>P</italic><sub>2</sub> &#x0003D; <italic>P</italic>[<italic>k</italic> &#x0002B; 1..|<italic>P</italic>|]&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x022B3; <italic>P</italic><sub>2</sub> is all the remaining records <italic>P</italic>&#x02212;<italic>P</italic><sub>1</sub></td>
</tr>
<tr>
<td align="left" valign="top"><sc>6</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;Calculate the cost of the partitions <italic>P</italic><sub>1</sub> and <italic>P</italic><sub>2</sub></td>
</tr>
<tr>
<td align="left" valign="top"><sc>7</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>if</bold> the cost is scer than minCost <bold>then</bold></td>
</tr>
<tr>
<td align="left" valign="top"><sc>8</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;Set chosenK &#x0003D; <italic>k</italic> and update minCost</td>
</tr>
<tr>
<td align="left" valign="top"><sc>9</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>return</bold> chosenK</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>We set <italic>M</italic> &#x0003D; &#x02308;|<italic>S</italic>|&#x000B7;<italic>B</italic>/|<italic>D</italic>|&#x02309; as explained in section 3 and <italic>m</italic> &#x0003D; 0.3<italic>M</italic> as recommended in the R*-tree paper. In particular, this phase starts by creating a single big tree node that has all the sample points <italic>S</italic>. Then, it recursively calls the <sc>SplitNode</sc> algorithm as long as the resulting node has more than <italic>M</italic> elements. This top-down approach has a key advantage over building the tree record-by-record as it allows the algorithm to look at all the records at the beginning and optimize for all of them. Furthermore, it avoids the <sc>ForcedReinsert</sc> algorithm which is known to slow down the R*-tree insertion process. Notice that this is different than the bulk loading algorithms as it does not produce a full tree. Rather, it just produces a set of boundaries that are produced as partitions. Phase 3 treats all the MBRs as leaf nodes in an R-tree and uses the <sc>ChooseLeaf</sc> method from the R*-tree to assign an input record to a partition.</p>
<sec>
<title>4.1.1. Run-Time Analysis</title>
<p>The <sc>SplitNode</sc> algorithm can be modeled as a recursive algorithm where each iteration sorts all the points and runs the linear-time splitting algorithm to produce two smaller partitions. The run-time can be expressed as <italic>T</italic>(<italic>n</italic>) &#x0003D; <italic>T</italic>(<italic>k</italic>) &#x0002B; <italic>T</italic>(<italic>n</italic> &#x02212; <italic>k</italic>) &#x0002B; <italic>O</italic>(<italic>n</italic> log <italic>n</italic>), where <italic>k</italic> is the size of one group resulting from the partitioning, <italic>n</italic> is the number of records in the input partition. In particular, <italic>T</italic>(<italic>k</italic>) and <italic>T</italic>(<italic>n</italic> &#x02212; <italic>k</italic>) are the running times to partition two partitions from splitting process. The term <italic>O</italic>(<italic>n</italic> log <italic>n</italic>) is the running time for the splitting part which requires sorting all the points. This recurrence relation has a worst case of <italic>n</italic><sup>2</sup>log<italic>n</italic> if <italic>k</italic> is always <italic>n</italic> &#x02212; 1. In order to guarantee a run-time of <italic>O</italic>(<italic>n</italic> log <sup>2</sup> <italic>n</italic>), we define a parameter &#x003C1; &#x02208; [0, 0.5] which defines the minimum splitting ratio <italic>k</italic>/<italic>n</italic>. Setting this parameter to any non-zero fraction guarantees an <italic>O</italic>(<italic>n</italic> log<sup>2</sup> <italic>n</italic>) run-time. However, the restriction of <italic>k</italic>/<italic>n</italic> also limits the range of possible value of <italic>k</italic>. For example, if <italic>n</italic> &#x0003D; 100 and &#x003C1; &#x0003D; 0.3, <italic>k</italic> must be a number in the range [30, 70]. As this parameter gets closer to 0.5, the two partitions become closer in size and the run-time decreases but the quality of the index might also deteriorate due to the limited search space imposed by this parameter. To incorporate this parameter in the node-splitting algorithm, we call the <sc>ChooseSplitPoint</sc> function with the parameters (<italic>P</italic>,max{<italic>m</italic>, &#x003C1;&#x000B7;|<italic>P</italic>|}), where |<italic>P</italic>| is the number of points in the list <italic>P</italic>.</p>
</sec></sec>
<sec>
<title>4.2. Load Balancing for Partitions With Equal-Size Records</title>
 <p>In this section, we focus on balancing the number of records in partitions assuming equal-size records. We further extend this in the next section to support variable-size records. The method in section 4.1 does a good job in producing high-quality partitions similar to what the R*-tree provides. However, it does not address the second limitation, that is, balancing the sizes of the partitions. Recall that the R-tree index family requires the leaf nodes to have sizes in the range [<italic>m, M</italic>], where <italic>m</italic> &#x02264; <italic>M</italic>/2. With the R*-tree algorithm explained earlier, some partitions might be 30% full which reduces block utilization and load balance. We would like to be able to set <italic>m</italic> to a larger value, say, <italic>m</italic> &#x0003D; 0.95<italic>M</italic>. Unfortunately, if we do so, the <sc>SplitNode</sc> algorithm would just fail because it will face a situation where there is no valid partitioning.</p>
<p>To illustrate the limitation of the <sc>SplitNode</sc> mechanism, consider the following simple example. Let us assume we choose <italic>m</italic> &#x0003D; 9 and <italic>M</italic> &#x0003D; 10 while the list <italic>P</italic> contains 28 points. If we call the <sc>SplitNode</sc> algorithm on the 28 points, it might produce two partitions with 14 records each. Since both contain more than <italic>M</italic> &#x0003D; 10 points, the splitting method will be called again on each of them which will produce an incorrect answer since there is no way to split 14 records into two groups while each of them contain between 9 and 10 records. A correct splitting algorithm would produce three partitions with sizes 9, 9, and 10. Therefore, we need to introduce a new constraint to the splitting algorithm so that it always produces partitions with sizes in the range [<italic>m, M</italic>].</p>
<sec>
<title>4.2.1. The Final Finding</title>
<p>The <sc>SplitNode</sc> algorithm can be minimally modified to guarantee final leaf partitions in the range [<italic>m, M</italic>] by satisfying the following validity constraint:</p>
<disp-formula id="E7"><mml:math id="M9"><mml:mrow><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>M</mml:mi></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x02264;</mml:mo><mml:mrow><mml:mo>&#x0230A;</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>&#x0230B;</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn></mml:mrow><mml:mo>}</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
<p>where <italic>S</italic><sub>1</sub> and <italic>S</italic><sub>2</sub> are the sizes of the two resulting partitions of the split. Algorithm 2 depicts the main changes to the algorithm that introduces a new constraint test in Line 3 that skips over invalid partitioning. The rest of this section provides the theoretical proof that this simple constraint guarantees the algorithm termination with leaf partitions in the range [<italic>m, M</italic>]. We start with the following definition.</p>
<table-wrap position="float">
<label>Algorithm 2</label>		 
<caption><p>R*-tree-based split while ensuring valid partitions</p>
<p>Inputs: <italic>P</italic> is the all sample records; [<italic>m, M</italic>] is the target range of sizes for final partitions.</p>
<p>Output: the optimal splitting position.</p></caption>
<table frame="hsides" rules="groups">
<tbody>
<tr>
<td align="left" valign="top"><sc>1</sc>:&#x000A0;&#x000A0;<bold>function</bold> <sc>ChooseValidSplitPoint</sc>(<italic>P</italic>,<italic>m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top"><sc>2</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>k</italic> in [<italic>m</italic>, |<italic>P</italic>| &#x02212; <italic>m</italic>] <bold>do</bold></td></tr>
<tr>
<td align="left" valign="top"><sc>3</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>if</bold> either <italic>k</italic> or |<italic>P</italic>| &#x02212; <italic>k</italic> is invalid <bold>then</bold>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x022B3; Lemma 1</td>
</tr>
<tr>
<td align="left" valign="top"><sc>4</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;Skip this iteration and <bold>continue</bold></td>
</tr>
<tr>
<td align="left" valign="top"><sc>5</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>Similar to Lines</italic>4&#x02212;8<italic>in Algorithm</italic> 1</td>
</tr>
<tr>
<td align="left" valign="top"><sc>6</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>return</bold> <italic>chosenK</italic></td>
</tr>
</tbody>
</table>
</table-wrap>
<p><bold> Definition 6. Valid Partition Size:</bold> <italic>An integer number</italic> <italic>S</italic> <italic>is said to be a valid partition size with respect to a range</italic> [<italic>m, M</italic>] <italic>if there exists a set of integers</italic> <italic>X</italic> &#x0003D; {<italic>x</italic><sub>1</sub>, &#x022EF;&#x02009;, <italic>x</italic><sub><italic>n</italic></sub>} <italic>such that</italic> &#x02211;<italic>x</italic><sub><italic>i</italic></sub> &#x0003D; <italic>S</italic> <italic>and</italic> <italic>x</italic><sub><italic>i</italic></sub> &#x02208; [<italic>m, M</italic>] &#x02200; <italic>i</italic> &#x02208; [1, <italic>n</italic>]<italic>. In words, if we have</italic> <italic>S</italic> <italic>records, there is at least one way to split them such that each split has between</italic> <italic>m</italic> <italic>and</italic> <italic>M</italic> <italic>records</italic>.</p>
<p>For example, if <italic>m</italic> &#x0003D; 9 and <italic>M</italic> &#x0003D; 10, the sizes 14, 31, and 62, are all invalid while the sizes 9, 27, and 63, are valid. Therefore, to produce balanced partitions, the <sc>SplitNode</sc> algorithm should keep the invariant that the partition sizes are always valid according to the above definition. Going back to the earlier example, if <italic>S</italic> &#x0003D; 28, the answer <italic>S</italic><sub>1</sub> &#x0003D; <italic>S</italic><sub>2</sub> &#x0003D; 14 will be rejected because <italic>S</italic><sub>1</sub> &#x0003D; 14 is invalid. Rather, the result of the first call to the <italic>SplitNode</italic> algorithm will result in two partitions with sizes {10, 18} or {9, 19}. The following lemma shows how to test a size for validity in constant time.</p>
<p><sc>Lemma 1</sc>. <italic><bold>Validity Test:</bold> An integer <italic>S</italic> is a valid partition size w.r.t a range [<italic>m, M</italic>] iff <italic>L</italic> &#x02264; <italic>U</italic> in which L (lower bound) and U (upper bound) are computed as</italic>:</p>
<disp-formula id="E8"><mml:math id="M10"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>L</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mi>S</mml:mi><mml:mo>/</mml:mo><mml:mi>M</mml:mi></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>U</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x0230A;</mml:mo><mml:mrow><mml:mi>S</mml:mi><mml:mo>/</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>&#x0230B;</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><sc>Proof</sc>. First, if <italic>S</italic> is valid then, by definition, there is a partitioning of <italic>S</italic> into <italic>n</italic> partitions such that each partition is in the range [<italic>m, M</italic>]. It is easy to show that <italic>L</italic> &#x02264; <italic>U</italic> and we omit this part for brevity. The second part is to show that if the inequality <italic>L</italic> &#x02264; <italic>U</italic> holds, then there is at least one valid partitioning. Based on the definition of <italic>L</italic> and <italic>U</italic>, we have:</p>
<disp-formula id="E9"><label>(1)</label><mml:math id="M11"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>U</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x0230A;</mml:mo><mml:mrow><mml:mi>S</mml:mi><mml:mo>/</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>&#x0230B;</mml:mo></mml:mrow><mml:mo>&#x021D2;</mml:mo><mml:mi>U</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mi>S</mml:mi><mml:mo>/</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>U</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>L</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>L</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mn>0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="E11"><label>(2)</label><mml:math id="M13"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>L</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mi>S</mml:mi><mml:mo>/</mml:mo><mml:mi>M</mml:mi></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x021D2;</mml:mo><mml:mi>L</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mi>S</mml:mi><mml:mo>/</mml:mo><mml:mi>M</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mi>M</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>L</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>L</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x02264;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>L</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Based on Inequalities 1 and 2, we can make a valid partitioning as follows:</p>
<list list-type="order">
<list-item><p>Start with <italic>L</italic> empty partitions. Assign <italic>m</italic> records to each partition. The remaining number of records is <italic>S</italic> &#x02212; <italic>m</italic>&#x000B7;<italic>L</italic> &#x02265; 0. This is satisfied due to Inequality 1.</p></list-item>
<list-item><p>Since each partition now has <italic>m</italic> records, it can receive up-to <italic>M</italic> &#x02212; <italic>m</italic> additional records in order to keep its validity. Overall, <italic>L</italic> partitions of size <italic>m</italic> can accommodate up-to (<italic>M</italic> &#x02212; <italic>m</italic>)&#x000B7;<italic>L</italic> records to keep a valid partitioning. But the remaining number of records <italic>S</italic> &#x02212; <italic>m</italic>&#x000B7;<italic>L</italic> is not larger than the upper limit of what the partitions can accommodate, (<italic>M</italic> &#x02212; <italic>m</italic>)&#x000B7;<italic>L</italic> as shown in Inequality 2. Therefore, this condition is satisfied as well.</p></list-item>
</list>
<p>In conclusion, it follows that if the condition <italic>L</italic> &#x02264; <italic>U</italic> holds, we can always find a valid partitioning scheme for <italic>S</italic> records which completes the proof.</p>
<p>If we apply this test for the example above, we find that 28 is valid because <italic>L</italic> &#x0003D; &#x02308;28/10&#x02309; &#x0003D; 3 &#x02264; <italic>U&#x00026;</italic> &#x0003D; &#x0230A;28/9&#x0230B; &#x0003D; 3 while 62 is invalid because <italic>L&#x00026;</italic> &#x0003D; &#x02308;62/10&#x02309; &#x0003D; 7&#x0003E;<italic>U&#x00026;</italic> &#x0003D; &#x0230A;62/9&#x0230B; &#x0003D; 6. This approach works fine as long as the initial sample size <italic>S</italic> is valid but how do we guarantee the validity of <italic>S</italic>? We show that this is easily guaranteed if the size <italic>S</italic> is above some threshold <italic>S</italic><sup>&#x0002A;</sup> as shown in the following lemma.</p>
<p><sc>Lemma 2</sc>. <italic>Given a range [<italic>m, M</italic>], any partition of size <italic>S</italic> &#x02265; <italic>S</italic><sup>&#x0002A;</sup> is valid where <italic>S</italic><sup>&#x0002A;</sup> is defined by the following formula:</italic></p>
<disp-formula id="E13"><label>(3)</label><mml:math id="M15"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:msup><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><sc>Proof</sc>. Following Definition 6, we will prove that for any partition size <italic>S</italic> &#x02265; <italic>S</italic><sup>&#x0002A;</sup>, there exists a way to split it into <italic>k</italic> groups such that the size of each group is in the range [<italic>m, M</italic>].</p>
<p>First, let <inline-formula><mml:math id="M16"><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow></mml:math></inline-formula>, we have:</p>
<disp-formula id="E14"><label>(4)</label><mml:math id="M17"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>S</mml:mi></mml:mtd><mml:mtd><mml:mo>&#x02265;</mml:mo><mml:msup><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="E15"><label>(5)</label><mml:math id="M18"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>X</mml:mi><mml:mo>,</mml:mo><mml:mi>X</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo><mml:mtext>&#x000A0;</mml:mtext><mml:mi>L</mml:mi><mml:mi>e</mml:mi><mml:mi>t</mml:mi><mml:mtext>&#x000A0;</mml:mtext><mml:mi>X</mml:mi><mml:mo>=</mml:mo><mml:mi>a</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>b</mml:mi></mml:mtd><mml:mtd><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mn>0</mml:mn><mml:mo>&#x02264;</mml:mo><mml:mi>b</mml:mi><mml:mo>&#x0003C;</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="E16"><label>(6)</label><mml:math id="M19"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mo>&#x021D2;</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>a</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>b</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>a</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>b</mml:mi></mml:mtd><mml:mtd><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mn>0</mml:mn><mml:mo>&#x02264;</mml:mo><mml:mi>b</mml:mi><mml:mo>&#x0003C;</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Second, since <italic>b</italic> &#x0003C; <italic>m</italic>, we have:</p>
<disp-formula id="E17"><label>(7)</label><mml:math id="M20"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:mfrac><mml:mo>&#x0003C;</mml:mo><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:mfrac><mml:mo>&#x02264;</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mfrac><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:mfrac><mml:mo>&#x0003C;</mml:mo><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>From Equations (6) and (7), we can make a valid partitioning for a partition size <italic>S</italic> as follows:</p>
<list list-type="order">
<list-item><p>Start with <italic>i</italic> &#x0002B; <italic>a</italic> empty partitions. Assign <italic>m</italic> records to each partition. The remaining number of records is <italic>b</italic>. This step is based on Equation (6).</p></list-item>
<list-item><p>Equation (7) means that we can split <italic>b</italic> records over <italic>i</italic> groups such that each group receives at most <italic>M</italic> &#x02212; <italic>m</italic> records. Since we already have <italic>i</italic> &#x0002B; <italic>a</italic> groups each of size <italic>m</italic>, adding <italic>M</italic> &#x02212; <italic>m</italic> to <italic>i</italic> groups out of them will increase their sizes to <italic>M</italic> which still keeps them in the valid range [<italic>m, M</italic>]. The remaining groups will still have <italic>m</italic> records making them valid too.</p></list-item>
</list>
<p>This completes the proof of Lemma 2.</p>
<p>Based on Lemma 2, a question is raised as how large the size of sample points <italic>S</italic> should be to ensure that a good block utilization is achievable. As we mentioned from beginning, R*-Grove allows us to configure a parameter &#x003B1; &#x0003D; <italic>m</italic>/<italic>M</italic>, that called <italic>balance factor</italic>, is computed as the ratio between minimum and maximum number of records of a leaf node in the tree. &#x003B1; should be close to 1 to guarantee a good block utilization. Let&#x00027;s assume that 0 &#x0003C; <italic>r</italic> &#x02264; 1 is the sampling ratio and <italic>p</italic> is the storage size of a single point. The maximum number of records <italic>M</italic> is computed in the section 4.1 as:</p>
<disp-formula id="E18"><label>(8)</label><mml:math id="M21"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>M</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>&#x000B7;</mml:mo><mml:mi>B</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x021D2;</mml:mo><mml:mi>M</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>&#x000B7;</mml:mo><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:mfrac><mml:mo>&#x000B7;</mml:mo><mml:mfrac><mml:mrow><mml:mi>B</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x021D2;</mml:mo><mml:mi>M</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>r</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>B</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>From Equation (8), we can rewrite Lemma 2 as:</p>
<disp-formula id="E19"><label>(9)</label><mml:math id="M22"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>&#x02265;</mml:mo><mml:msup><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mo>*</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi><mml:mo>-</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>&#x02265;</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>&#x003B1;</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>r</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>B</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtext>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;</mml:mtext><mml:mtd><mml:mo>&#x021D2;</mml:mo><mml:mo>|</mml:mo><mml:mi>S</mml:mi><mml:mo>|</mml:mo><mml:mo>&#x000B7;</mml:mo><mml:mi>p</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>&#x003B1;</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>&#x003B1;</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow><mml:mo>&#x000B7;</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mi>r</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>B</mml:mi></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Therefore, assume that we want to configure the <italic>balance factor</italic> as &#x003B1; &#x0003D; 0.95, sample ratio <italic>r</italic> &#x0003D; 1%, and block size <italic>B</italic> &#x0003D; 128 MB, then the term |<italic>S</italic>|&#x000B7;<italic>p</italic> in Equation (9) would be computed as 23 MB. In other words, if the storage size of sample points |<italic>S</italic>|&#x000B7;<italic>p</italic> &#x02265; 23 MB, it will be guaranteed to produce a valid partitioning. This is a reasonable size that can be stored in main memory and processed in a single machine.</p></sec></sec>
<sec>
<title>4.3. Load Balancing for Datasets With Variable-Size Records</title>
<p>The above two approaches can be combined to produce high-quality and balanced partitions in terms of number of records. However, the partitioning technique needs to write the actual records in each partition and often these records are of variable sizes. For example, the sizes of records in the <monospace>OSM-Objects</monospace> dataset (allobjects, <xref ref-type="bibr" rid="B1">2019</xref>) range from 12 bytes to 10 MB per record. Therefore, balancing the number of records can result in a huge variance in the partition sizes in terms of number of bytes.</p>
<p>To overcome this limitation, we combine the sample points with a <italic>storage size histogram</italic> of the input as follows. The storage size histogram is used to assign a weight to each sample point that represents the total size of all records in its vicinity. To find these weights, Phase 1 computes, in addition to the sample, a storage size histogram of the input. This histogram is created by overlaying a uniform grid on the input space and computing the total size of all records that lie in each grid cell (Chasparis and Eldawy, <xref ref-type="bibr" rid="B6">2017</xref>; Siddique et al., <xref ref-type="bibr" rid="B33">2019</xref>). This histogram is computed on the full dataset not the sample, therefore, it catches the actual size of the input. After that, we count the number of <italic>sample</italic> points in each grid cell. Finally, we divide the total weight of each cell among all sample points in this cell. For example, if a cell has a weight of 1,000 bytes and contains five sample points, the weight of each point in this cell becomes 200 bytes.</p>
<p>In Phase 2, the <sc>SplitNode</sc> function is further improved to balance the <italic>total weight</italic> of the points in each partition rather than the number of points. This also requires modifying the value of <italic>M</italic> to be <italic>M</italic> &#x0003D; &#x02308;&#x02211;<italic>w</italic><sub><italic>i</italic></sub>/<italic>N</italic>&#x02309;, where <italic>w</italic><sub><italic>i</italic></sub> is the assigned weight to the sample point <italic>p</italic><sub><italic>i</italic></sub>, and <italic>N</italic> is the desired number of partitions. Algorithm 3 shows how the algorithm is modified to take the weights into account. Line 4 calculates the weight of each partitioning point which is used to test the validity of this split point as shown in Line 5.</p>
<table-wrap position="float">
<label>Algorithm 3</label>
<caption><p>Choose the split point with weights</p>
<p>Inputs: <italic>P</italic> is the all sample records; <italic>w</italic> is an array of weights of corresponding records in <italic>P</italic>; [<italic>m, M</italic>] is the target range of sizes for final partitions.</p>
<p>Output: the optimal splitting position.</p></caption>
<table frame="hsides" rules="groups">
<tbody>
<tr>
<td align="left" valign="top"><sc>1:</sc>&#x000A0;&#x000A0;&#x000A0;<bold>function</bold> <sc>ChooseWeightedSplitPoint</sc>(<italic>P</italic>,<italic>w</italic>,<italic>m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top"><sc>2:</sc>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<inline-formula><mml:math id="M24"><mml:mi>W</mml:mi><mml:mo>=</mml:mo><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x02264;</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mo>|</mml:mo><mml:mi>P</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula></td>
</tr>
<tr>
<td align="left" valign="top"><sc>3:</sc>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>k</italic> in [<italic>m</italic>, |<italic>P</italic>| &#x02212; <italic>m</italic>] <bold>do</bold></td>
</tr>
<tr>
<td align="left" valign="top"><sc>4:</sc>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<inline-formula><mml:math id="M25"><mml:msub><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x02264;</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mi>k</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula></td>
</tr>
<tr>
<td align="left" valign="top"><sc>5:</sc>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>if</bold> either <italic>W</italic><sub>1</sub> or <italic>W</italic> &#x02212; <italic>W</italic><sub>1</sub> is invalid <bold>then</bold> &#x022B3; Lemma 1</td>
</tr>
<tr>
<td align="left" valign="top"><sc>6:</sc>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;Skip this iteration and continue</td>
</tr>
<tr>
<td align="left" valign="top"><sc>7</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>SimilartoLines</italic>4&#x02212;8<italic>in Algorithm</italic> 1</td>
</tr>
<tr>
<td align="left" valign="top"><sc>8</sc>:&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>return</bold> <italic>chosenK</italic></td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Unfortunately, if we apply this change, the algorithm is no longer guaranteed to produce balanced partitions. The reason is that the proof of Lemma 1 is no longer valid. That proof assumed that the partition sizes are defined in terms of number of records which makes all possible partition sizes part of the search space in the <bold>for-loop</bold> in Line 2 of Algorithm 2. However, when the size of each partition is the sum of the weights, the possible sizes are limited to the weights of the points. For example, let us assume a partition with five points all of the same weight <italic>w</italic><sub><italic>i</italic></sub> &#x0003D; 200 while <italic>m</italic> &#x0003D; 450 and <italic>M</italic> &#x0003D; 550. The condition in Definition 6 suggests that the total weight 1, 000 is valid because <italic>L</italic> &#x0003D; &#x02308;1, 000/550&#x02309; &#x0003D; 2 &#x02264; <italic>U</italic> &#x0003D; &#x0230A;1000/450&#x0230B; &#x0003D; 2. However, given the weights <italic>w</italic><sub><italic>i</italic></sub> &#x0003D; 200 for <italic>i</italic> &#x02208; [1, 5], there is no valid partitioning, i.e., there is no way to make two partitions each with a total weight in the range [450, 550].</p>
<p>To overcome this issue, this part further improves the <sc>SplitNode</sc> algorithm so that it still guarantees a valid partitioning even for the case described above. The key idea is to make minimal changes to the weights to ensure that the algorithm will terminate with a valid partitioning; we call this process <italic>weight correction</italic>. For example, the case described earlier will be resolved by changing the weights of two points from 200 and 200 to 100 and 300. This will result in the valid partitioning {200, 200, 100} and {300, 200} which is valid. Keep in mind that these weights are approximate anyway as they are based on the sample and histogram so these minimal changes would not hugely affect the overall quality, yet, they ensure that the algorithm will terminate correctly. The following part describes how these weight changes are applied while ensuring a valid answer.</p>
<p>First of all, we assume that the points are already sorted along the chosen axis as explained in section 4.1. Further, we assume that Algorithm 3 failed by not finding any valid partitions, i.e., return &#x02212;1. Now, we make the following definitions to use them in the weight update function.</p>
<p><sc>Definition 7</sc>. <bold><italic>Point position:</italic> </bold><italic>Let</italic> <italic>p</italic><sub><italic>i</italic></sub> <italic>be point</italic> <italic>&#x00023;i</italic> <italic>in the sort order and its weight is</italic> <italic>w</italic><sub><italic>i</italic></sub><italic>. We define the position of the point</italic> <italic>i</italic> <italic>as</italic> <inline-formula><mml:math id="M26"><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>.</p>
<p>Based on this definition, we can place all the points on a linear scale based on their position as shown in <xref ref-type="fig" rid="F3">Figure 3A</xref>.</p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>Load balancing for datasets with variable-size records. <bold>(A)</bold> Positions of points, <bold>(B)</bold> Valid ranges, <bold>(C)</bold> Weight correction.</p></caption>
<graphic xlink:href="fdata-03-00028-g0003.tif"/>
</fig>
<p><sc>Definition 8</sc>. <bold><italic>Valid left range:</italic> </bold><italic>A range of positions</italic> <italic>VL</italic> &#x0003D; [<italic>vl</italic><sub><italic>s</italic></sub>, <italic>vl</italic><sub><italic>e</italic></sub>] <italic>is a valid left range if for all positions</italic> <italic>vl</italic> &#x02208; <italic>VL</italic> <italic>the value</italic> <italic>vl</italic> <italic>is valid w.r.t</italic>. [<italic>m, M</italic>]<italic>. All the valid left ranges can be written in the form</italic> [<italic>im, iM</italic>] <italic>where</italic> <italic>i</italic> <italic>is a natural number and they might overlap for large values of</italic> <italic>i</italic> <italic>(see</italic> <xref ref-type="fig" rid="F3"><italic>Figure 3B</italic></xref><italic>)</italic>.</p>
<p><sc>Definition 9</sc>. <bold><italic>Valid right range:</italic> </bold><italic>A range of positions</italic> <italic>VR</italic> &#x0003D; [<italic>vr</italic><sub><italic>s</italic></sub>, <italic>vr</italic><sub><italic>e</italic></sub>] <italic>is a valid right range if for all positions</italic> <italic>vr</italic> &#x02208; <italic>VR</italic> <italic>the value</italic> <italic>W</italic> &#x02212; <italic>vr</italic> <italic>is valid w.r.t</italic>. [<italic>m, M</italic>]<italic>. Similar to valid left ranges, all valid right ranges can be written in the form</italic> [<italic>W</italic> &#x02212; <italic>jM, W</italic> &#x02212; <italic>jm</italic>]<italic>, where</italic> <italic>W</italic> &#x0003D; &#x02211;<italic>w</italic><sub><italic>i</italic></sub> <italic>(see</italic> <xref ref-type="fig" rid="F3"><italic>Figure 3B</italic></xref><italic>)</italic>.</p>
<p><sc>Definition 10</sc>. <bold><italic>Valid range:</italic> </bold><italic>A range of positions</italic> <italic>V</italic> &#x0003D; [<italic>v</italic><sub><italic>s</italic></sub>, <italic>v</italic><sub><italic>e</italic></sub>] <italic>is valid if for all positions</italic> <italic>v</italic> &#x02208; <italic>V</italic>, <italic>v</italic> <italic>belongs to at least one valid left range and at least one valid right range. In other words, the valid ranges are the intersection of the valid left ranges and valid right ranges</italic>.</p>
<p><xref ref-type="fig" rid="F3">Figure 3B</xref> illustrates the valid left, valid right, and valid ranges. If we split a partition around a point with a position in a valid left range, the first partition will be valid. Similarly for valid right positions the second partition (on the right) will be valid. Therefore, we would like to split a partition around a point in one of the valid ranges (intersection of left and right).</p>
<p><sc>Lemma 3</sc>. <italic><bold>Empty valid ranges:</bold> If Algorithm 3 fails by returning &#x02212;1, then none of the point positions in <italic>P</italic> falls in a valid range</italic>.</p>
<p><sc>Proof</sc>. By contradiction, let a point <italic>p</italic><sub><italic>i</italic></sub> has a position <italic>pos</italic><sub><italic>i</italic></sub> that falls in a valid range. In this case, the partitions <italic>P</italic><sub>1</sub> &#x0003D; {<italic>p</italic><sub><italic>k</italic></sub>:<italic>k</italic> &#x02264; <italic>i</italic>} and <italic>P</italic><sub>2</sub> &#x0003D; {<italic>p</italic><sub><italic>l</italic></sub>:<italic>l</italic>&#x0003E;<italic>i</italic>} are both valid partitions because the total weight of <italic>P</italic><sub>1</sub> is equal to the position <italic>pos</italic><sub><italic>i</italic></sub> which is valid because <italic>pos</italic><sub><italic>i</italic></sub> falls in a valid left range. Similarly, the total weight of <italic>P</italic><sub>2</sub> is valid because <italic>pos</italic><sub><italic>i</italic></sub> falls in a valid right range. In this case, Algorithm 3 should have found this partitioning as a valid partitioning because it tests all the points which is a contradiction.</p>
<p>A corollary to Lemma 3 is that when Algorithm 3 fails by returning &#x02212;1, then all valid ranges are empty.</p>
<p>As a result, we would like to slightly modify the weights of some points in the sample points in order to enforce some points to fall in valid ranges. We call this the <italic>weight correction</italic> process. This process is described in the following lemma:</p>
<p><sc>Lemma 4</sc>. <italic><bold>Weight correction:</bold> Given any empty valid range [<italic>v</italic><sub><italic>s</italic></sub>, <italic>v</italic><sub><italic>e</italic></sub>], we can modify the weight of only two points such that the position of one of them will fall in the range</italic>.</p>
<p><sc>Proof</sc>. <xref ref-type="fig" rid="F3">Figure 3C</xref> illustrates the proof of this lemma. Given an empty valid range, we modify the two points with positions that follow the empty valid range, <italic>p</italic><sub>1</sub> and <italic>p</italic><sub>2</sub>, where <italic>pos</italic><sub>1</sub> &#x0003C; <italic>pos</italic><sub>2</sub>. We would like to move the point <italic>p</italic><sub>1</sub> to the new position <inline-formula><mml:math id="M27"><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:msubsup><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>/</mml:mo><mml:mn>2</mml:mn></mml:math></inline-formula> which is in the middle of the empty valid range. To do that, we reduce the weight <italic>w</italic><sub>1</sub> by <inline-formula><mml:math id="M28"><mml:mo>&#x00394;</mml:mo><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:mi>s</mml:mi><mml:mo>=</mml:mo><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:msubsup><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup></mml:math></inline-formula>. The updated weight <inline-formula><mml:math id="M29"><mml:msubsup><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mo>&#x00394;</mml:mo><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:mi>s</mml:mi></mml:math></inline-formula>. To keep the position of <italic>p</italic><sub>2</sub> and all the following points intact, we have to also increase the weight of <italic>p</italic><sub>2</sub> by &#x00394;<italic>pos</italic>; that is, <inline-formula><mml:math id="M30"><mml:msubsup><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mo>&#x00394;</mml:mo><mml:mi>p</mml:mi><mml:mi>o</mml:mi><mml:mi>s</mml:mi></mml:math></inline-formula>.</p>
<p>We do the weight correction process for <italic>all</italic> empty valid ranges to make them non-empty and then we repeat Algorithm 3 to choose the best one among them.</p>
<p>The only remaining part is how to enumerate all the valid ranges. The idea is to simply find a valid left range, an overlapping valid right range, and compute their intersection, all in constant time. Given a natural number <italic>i</italic>, the valid left range is in the form [<italic>im, iM</italic>]. Assume that this range overlaps a valid right range in the form [<italic>W</italic> &#x02212; <italic>jM, W</italic> &#x02212; <italic>jm</italic>]. Since they overlap, the following two inequalities should hold:</p>
<disp-formula id="E21"><mml:math id="M31"><mml:mrow><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>j</mml:mi><mml:mi>m</mml:mi><mml:mo>&#x02265;</mml:mo><mml:mi>i</mml:mi><mml:mi>m</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x0003C;</mml:mo><mml:mfrac><mml:mrow><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<disp-formula id="E22"><mml:math id="M32"><mml:mrow><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>j</mml:mi><mml:mi>M</mml:mi><mml:mo>&#x02264;</mml:mo><mml:mi>i</mml:mi><mml:mi>M</mml:mi><mml:mo>&#x021D2;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x0003E;</mml:mo><mml:mfrac><mml:mrow><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>i</mml:mi><mml:mi>M</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<p>Therefore, the lower bound of <italic>j</italic> is <inline-formula><mml:math id="M33"><mml:msub><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x02308;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>M</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x02309;</mml:mo></mml:mrow></mml:math></inline-formula> and the upper bound of <italic>j</italic> is <inline-formula><mml:math id="M34"><mml:msub><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mo>&#x0230A;</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mi>W</mml:mi><mml:mo>-</mml:mo><mml:mi>i</mml:mi><mml:mo>&#x000B7;</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:mo>&#x0230B;</mml:mo></mml:mrow></mml:math></inline-formula>. If <italic>j</italic><sub>1</sub> &#x02264; <italic>j</italic><sub>2</sub>, then there is a solution to these inequalities which we use to generate the bounds of the valid range [<italic>v</italic><sub><italic>s</italic></sub>, <italic>v</italic><sub><italic>e</italic></sub>]. Notice that if there is more than one valid solution to <italic>j</italic>, all of them should be considered to generate all the valid ranges but we omit this special case for brevity.</p></sec>
<sec>
<title>4.4. Implementation Considerations</title>
<sec>
<title>4.4.1. Optimization of Phase 3</title>
<p>The <sc>ChooseSubTree</sc> operation in R*-tree chooses the node that results in the least overlap increase with its siblings (Beckmann et al., <xref ref-type="bibr" rid="B2">1990</xref>). A straight-forward implementation of this method is <italic>O</italic>(<italic>n</italic><sup>2</sup>) as it needs to compute the overlap between each candidate partition and all other partitions. In the R*-tree index, this cost is limited due to the limited size of each node. However, this step can be too slow as the number of partitions in R*-Grove can be extremely large. To speed up this step, we use a K-d-tree-like auxiliary search structure as shown in <xref ref-type="fig" rid="F4">Figure 4</xref>. This index structure is generated during Phase 2 as the partition boundaries are computed. Each time the <sc>NodeSplit</sc> operation completes, the search structure is updated by adding a corresponding split in the direction of the chosen split axis. This auxiliary search structure is stored in memory and replicated to all nodes. It will be used in Phase 3, when we physically store the input records to the partitions. Given a spatial record, it will be assigned to the corresponding partition using a search algorithm which is similar to the K-d-tree&#x00027;s point search algorithm (Bentley, <xref ref-type="bibr" rid="B5">1975</xref>). Based on this similarity, we can estimate the running time to choose a partition to be <italic>O</italic>(<italic>log</italic>(<italic>n</italic>)). Notice that this optimization is not applicable in traditional R*-trees as the partitions might be overlapping while in R*-Grove we utilize the fact that we only partition points which guarantees disjoint partitions.</p>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p>Auxiliary search structure for R*-Grove.</p></caption>
<graphic xlink:href="fdata-03-00028-g0004.tif"/>
</fig>
<p>Since the partition MBRs in Phase 2 are computed from sample objects, there will be objects which do not fall in any partition in Phase 3. R*-Grove addresses this problem in two ways. First, if no disjoint partitions are desired, it chooses a single partition based on the <sc>ChooseLeaf</sc> method in original R*-tree. In short, an object will be assigned to the partition in which the enlarged area or margin is minimal. Second, if disjoint partitions are desired, R*-Grove uses the auxiliary data structure, which covers the entire space, to assign this record to all overlapping partitions.</p></sec>
<sec>
<title>4.4.2. Disjoint Indexes</title>
<p>Another advantage of using the auxiliary search structure described above, is that it allows for building a disjoint index. This search structure naturally provides disjoint partitions. To ensure that the partitions cover the entire input space, we assume that input region is infinite, that is, starts from &#x02212;&#x0221E; and ends at &#x0002B;&#x0221E; in all dimensions. Then, Phase 3 replicates each record to all overlapping partitions by directly searching in this <italic>k</italic>-d-tree-like structure with range search algorithm, which has the <inline-formula><mml:math id="M35"><mml:mi>O</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msqrt><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msqrt></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> running time (Lee and Wong, <xref ref-type="bibr" rid="B23">1977</xref>). This advantage was not possible with the black-box R*-tree implementation as it is not guaranteed to provide disjoint partitions.</p></sec></sec></sec>
<sec id="s5">
<title>5. Case Studies</title>
<p>This section describes three case studies where the R*-Grove partitioning technique can improve big spatial data processing. We consider three fundamental operations, namely, indexing, range query, and spatial join.</p>
<sec>
<title>5.1. Indexing</title>
<p>Spatial data indexing is an essential component in most big spatial data management systems. The state-of-the-art global indexing techniques rely on reusing existing index structures with a sample which are shown to be inefficient in terms of quality and load balancing (Vo et al., <xref ref-type="bibr" rid="B36">2014</xref>; Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>; Yu et al., <xref ref-type="bibr" rid="B41">2015</xref>).</p>
<p>R*-Grove partitioning can be used for the <italic>global indexing</italic> step which partitions records across machines. In big spatial data indexing, the global index is the most crucial step as it ensures load balancing and efficient pruning when the index is used. If only the number of records needs to be balanced or if the records are roughly equi-sized, then the techniques described in sections 4.1 and 4.2 can be used. If the records are of a variable size and the total sizes of partitions need to be balanced, then the histogram-based step in section 4.3 can be added to ensure a higher load balance. Notice that the index would hugely benefit from the balanced partition size as it reduces the total number of blocks in the output file which improves the performance of all Spark and MapReduce queries that create one task per file block.</p></sec>
<sec>
<title>5.2. Range Query</title>
<p>Range query is a popular spatial query, which is also the building block of many other complex spatial queries. Previous studies found a strong correlation between the performance of range queries and the performance of other queries such as spatial join (Hoel and Samet, <xref ref-type="bibr" rid="B20">1994</xref>; Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>). Therefore, the performance of range query could be considered as a good reflection about the quality of a partitioning technique. A good partitioning technique allows the query processor to make two optimization techniques. First, it can prune the partitions that are completely outside the query range. Second, it can directly write to the output the partitions that are completely contained in the query range without further processing (Eldawy et al., <xref ref-type="bibr" rid="B8">2017</xref>). For very small ranges, most partitioning techniques will behave similarly as it is most likely that the small query overlaps one partition and no partitions are completely contained (Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>). However, as the query range increases, the differences between the partitioning techniques become apparent. Since most range queries are expected to be square-like, the R*-Grove partitioning is expected to perform very well as it minimizes the total margin which produces square-like partitions. Furthermore, the balanced load across partitions minimizes the straggler effect where one partition takes significantly longer time than all other partitions.</p></sec>
<sec>
<title>5.3. Spatial Join</title>
<p>Spatial join is another important spatial query that benefits from the improved R*-Grove partitioning technique. In spatial join, two big datasets need to be combined to find all the overlapping pairs of records. To support spatial join on partitioned big spatial data, each dataset is partitioned independently. Then, a spatial join runs between the partition boundaries to find all pairs of overlapping partitions. Finally, these pairs of partitions are processed in parallel. An existing approach (Zhou et al., <xref ref-type="bibr" rid="B42">1998</xref>) preserves spatial locality to reduce the processing jobs. However, it still relies on traditional index like R-Tree, which also inherited its limitations. The R*-Grove partitioning has two advantages for the spatial join operation. First, it is expected to reduce the number of partitions by increasing the load balance which reduces the total number of pairs. Second, it produces square-like partitions which is expected to overlap with fewer partitions of the other dataset as compared to the very thin and wide partitions that the STR or other partitioning techniques produce. These advantages allows R*-Grove to significantly outperform other partitioning techniques in spatial join query performance. We will validate these advantages in the section 6.5.2.</p></sec></sec>
<sec id="s6">
<title>6. Experiments</title>
<p>In this section, we carry out an extensive experimental study to validate the advantages of R*-Grove over widely used partitioning techniques, such as bulk loading STR, Kd-tree, Z-Curve, and Hilbert curve. We will show how R*-Grove addresses the current limitations of those techniques, leads to a better performance in big spatial data processing. In addition, we also show other capabilities of R*-Grove in the context of big spatial data, for example, how it works with large or multi-dimensional datasets. The experimental results in this section provide an evidence to the spatial community to start using R*-Grove if they would like to improve the system performance of their spatial applications.</p>
<sec>
<title>6.1. Experimental Setup</title>
<sec>
<title>6.1.1. Datasets</title>
<p><xref ref-type="table" rid="T1">Table 1</xref> summarizes the datasets will be used in our experiments. We use both real world and synthetic datasets for our experiments: (1) Semi-synthetic OpenStreetMap (<monospace>OSM-Nodes</monospace>) dataset with 7.4 billion points and a total size of 500 GB. This is a semi-synthetic dataset which represents all the points in the world. The points in this dataset are generated within a pre-specified distance from original points from <monospace>OSM-Nodes</monospace> dataset; (2) <monospace>OSM-Roads</monospace> with size 20 GB; and (3) <monospace>OSM</monospace> <monospace>Parks</monospace> with size 7.2 GB, which contain line segments and polygons for spatial join experiments. (4) <monospace>OSM-Objects</monospace> dataset with size 92 GB, which contains many variable-size records. (5) <monospace>NYC-Taxi</monospace> dataset with size 41.7 GB with up-to seven dimensions. All of those datasets are available online on UCR-STAR (ucrstar, <xref ref-type="bibr" rid="B35">2019</xref>)&#x02014;our public repository for spatial data; (6) Synthetic multi-dimensional <monospace>diagonal</monospace> points, with the number of dimensions are 3, 4, 5, and 9. This synthetic dataset is generated using our open source Spatial Data Generator (Vu et al., <xref ref-type="bibr" rid="B38">2019</xref>). Dataset (5) and (6) allow us to show the advantages of R*-Grove in multi-dimensional datasets.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Datasets for experiments.</p></caption>
<table frame="hsides" rules="groups">
<thead><tr>
<th valign="top" align="left"><bold>Dataset</bold></th>
<th valign="top" align="left"><bold>Type</bold></th>
<th valign="top" align="center"><bold>Dimensions</bold></th>
<th valign="top" align="center"><bold>Size (GB)</bold></th>
<th valign="top" align="left"><bold>&#x00023; Records</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">(1) OSM-Nodes</td>
<td valign="top" align="left">Point</td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">500</td>
<td valign="top" align="left">7.4 billions</td>
</tr>
<tr>
<td valign="top" align="left">(2) OSM-Roads</td>
<td valign="top" align="left">Line segments</td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">20</td>
<td valign="top" align="left">59 millions</td>
</tr>
<tr>
<td valign="top" align="left">(3) OSM-Parks</td>
<td valign="top" align="left">Polygon</td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">7.2</td>
<td valign="top" align="left">10 millions</td>
</tr>
<tr>
<td valign="top" align="left">(4) OSM-Objects</td>
<td valign="top" align="left">Polygon</td>
<td valign="top" align="center">2</td>
<td valign="top" align="center">96</td>
<td valign="top" align="left">264 millions</td>
</tr>
<tr>
<td valign="top" align="left">(5) NYC-Taxi</td>
<td valign="top" align="left">Point</td>
<td valign="top" align="center">4,5,7</td>
<td valign="top" align="center">46</td>
<td valign="top" align="left">173 millions</td>
</tr>
<tr>
<td valign="top" align="left">(6) Diagonal points</td>
<td valign="top" align="left">Point</td>
<td valign="top" align="center">3,4,5,9</td>
<td valign="top" align="center">100</td>
<td valign="top" align="left">80 millions</td>
</tr>
</tbody>
</table>
</table-wrap></sec>
<sec>
<title>6.1.2. Parameters and Performance Metrics</title>
<p>In the following experiments, we partition the mentioned datasets with different datasets size |<italic>D</italic>| in different techniques then we measure: (1) partition quality metrics, namely, total partition area, total partition margin, total partition overlap, block utilization(maximum is 1.0, i.e. 100%), standard deviation of partition size in MB (load balance). Notice that unit is not relevant for area, margin and overlap metric; (2) total partitioning time (in seconds), (3) for range queries, we measure the number of processed blocks and query running time, (4) for spatial join, we measure the number of processed blocks and total running time. We fix the balance factor &#x003B1; &#x0003D; 0.95 and HDFS block size at 128 MB.</p></sec>
<sec>
<title>6.1.3. Machine Specs</title>
<p>All the experiments are executed on a cluster of one head node and 12 worker nodes, each having 12 cores, 64 GB of RAM, and a 10 TB HDD. They run CentOS 7 and Oracle Java 1.8.0_131. The cluster is equipped with Apache Spark 2.3.0 and Apache Hadoop 2.9.0. The proposed indexes are available for running in both Spark and Hadoop. Unless otherwise mentioned, we use Spark by default. The source code is available at <ext-link ext-link-type="uri" xlink:href="https://bitbucket.org/tvu032/beast-tv/src/rsgrove/">https://bitbucket.org/tvu032/beast-tv/src/rsgrove/</ext-link>. The implementation for R*-Grove (<italic>RSGrovePartitioner</italic>) is located at <italic>indexing</italic> package.</p></sec>
<sec>
<title>6.1.4. Baseline Techniques</title>
<p>We compare R*-Grove to K-d Tree, STR, Z-curve, and Hilbert curve (denoted H-Curve thereafter) which are widely used in existing big spatial data systems (Eldawy and Mokbel, <xref ref-type="bibr" rid="B12">2016</xref>). Z-Curve is adopted in some systems under the name Geohash which behaves in the same way.</p></sec></sec>
<sec>
<title>6.2. Effectiveness of the Proposed Improvements in R*-Grove</title>
<p>In this experiment, we compare the three following variants of R*-Grove: (1) <italic>R*-tree-black-box</italic> is the application of the method in section 4.1. Simply, it uses the basic R*-tree algorithm to compute high-quality partition but it does not guarantee a high block utilization or load balance. (2) <italic>R*-tree-gray-box</italic> applies the improvements in sections 4.1 and 4.2. In addition to the high-quality partition, this method can also guarantee a high block utilization in terms of number of records per partition but it does not perform well if records have highly-variable sizes since it does <italic>not</italic> include the size adjustment technique in section 4.3. (3) <italic>R*-Grove</italic> applies all the three improvements at sections 4.1, 4.2, and 4.3. It has the advantage of producing high-quality partitions and can also guarantee a high block utilization in terms of storage size even when the record sizes are highly variable.</p>
<p>In <xref ref-type="fig" rid="F5">Figure 5</xref>, we partition the <monospace>OSM-Objects</monospace> dataset, which contains variable-size records to validate our proposed improvements. Overall, R*-Grove outperforms R*-tree-black-box and R*-tree-gray-box in all of spatial quality metrics. Especially, R*-Grove provides excellent load balance between partitions as shown in <xref ref-type="fig" rid="F5">Figure 5D</xref>, which is the standard deviation of partition size in <monospace>OSM-Objects</monospace> dataset. Given the HDFS block size is 128 MB, R*-Grove has the standard deviation of partition size 5 &#x02212; 6 times smaller than R*-Tree-gray-box and R*-Tree-black-box. Since then, the following experiments will evaluate the performance of R*-Grove with existing widely-used spatial partitioning techniques.</p>
<fig id="F5" position="float">
<label>Figure 5</label>
<caption><p>Partition quality with variable-record-size dataset in R*-Grove and its two variants, R*-tree-black-box and R*-tree-gray-box. <bold>(A)</bold> Total area, <bold>(B)</bold> Total margin, <bold>(C)</bold> Block utilization, <bold>(D)</bold> Load balance.</p></caption>
<graphic xlink:href="fdata-03-00028-g0005.tif"/>
</fig></sec>
<sec>
<title>6.3. Results Overview</title>
<p><xref ref-type="fig" rid="F6">Figure 6</xref> shows an overview of the advantages of R*-Grove over other partitioning techniques for indexing, range query, and spatial join. In this experiment, we compare to four popular baseline techniques, namely, STR, Kd-Tree, Z-Curve, and H-Curve. We use <monospace>OSM-Nodes</monospace> dataset (ucrstar, <xref ref-type="bibr" rid="B35">2019</xref>) for this experiment. The numbers on the <italic>y</italic> &#x02212; <italic>axis</italic> are normalized to the largest number for a better representation except for block utilization which is reported as-is. Except for block utilization, the lower the value in the chart the better it is. The first two groups, total area and total margin, show that index quality of R*-Grove is clearly better than other baselines in both measures. For block utilization, on average, a partition in R*-Grove occupy around 90%, while other techniques could only utilize 60 &#x02212; 70% storage capacity of an HDFS block. R*-Grove also has a better load balance when compared to other techniques. The last two groups indicate that R*-Grove significantly outperforms other partitioning techniques in terms of range query and spatial join query performance. We will go into further details in the rest of this section.</p>
<fig id="F6" position="float">
<label>Figure 6</label>
<caption><p>The advantages of R*-Grove when compared to existing partitioning techniques.</p></caption>
<graphic xlink:href="fdata-03-00028-g0006.tif"/>
</fig></sec>
<sec>
<title>6.4. Partition Quality</title>
<p>This section shows the advantages of R*-Grove for indexing big spatial data when compared to other partitioning techniques. We use <monospace>OSM-Nodes</monospace> and <monospace>OSM-Objects</monospace> dataset with size up to 200 and 92 GB, respectively. We compare five techniques, namely, R*-Grove, STR, Kd-Tree, Z-Curve and H-Curve. We implemented those techniques on Spark with sampling-based partitioning mechanism. <xref ref-type="fig" rid="F7">Figures 7A</xref>, <xref ref-type="fig" rid="F8">8A</xref> show that there is no significant difference of indexing performance between different techniques. This result is expected since the main difference between them is in Phase 2 which runs on a single machine on a sample of a small size (and a histogram in case of R*-Grove). Typically, Phase 2 takes only a few seconds to finish. These results suggest that the proposed R*-Grove algorithm requires the same computational resources as the baseline techniques. Meanwhile, it provides a better query performance by providing a higher partition quality as detailed next.</p>
<fig id="F7" position="float">
<label>Figure 7</label>
<caption><p>Indexing performance and partition quality of R*-Grove and other partitioning techniques in <monospace>OSM-Nodes</monospace> datasets with similar-size records. <bold>(A)</bold> Partitioning time, <bold>(B)</bold> Total area, <bold>(C)</bold> Total margin, <bold>(D)</bold> Block utilization, <bold>(E)</bold> Load balance, <bold>(F)</bold> Range query performance.</p></caption>
<graphic xlink:href="fdata-03-00028-g0007.tif"/>
</fig>
<fig id="F8" position="float">
<label>Figure 8</label>
<caption><p>Indexing performance and partition quality of R*-Grove and other partitioning techniques in <monospace>OSM-Objects</monospace> dataset with variable-size records. <bold>(A)</bold> Partitioning time, <bold>(B)</bold> Total area, <bold>(C)</bold> Total margin, <bold>(D)</bold> Block utilization, <bold>(E)</bold> Load balance, <bold>(F)</bold> Average range query cost.</p></caption>
<graphic xlink:href="fdata-03-00028-g0008.tif"/>
</fig>
<sec>
<title>6.4.1. Total Area and Total Margin</title>
<p><xref ref-type="fig" rid="F7">Figures 7B</xref>, <xref ref-type="fig" rid="F8">8B</xref> show the total area of indexed datasets when we vary the <monospace>OSM-Nodes</monospace> and <monospace>OSM-Objects</monospace> dataset size from 20 to 200 GB and 16 to 92 GB, respectively. R*-Grove is the winner since it minimizes the total area of all partitions. While H-Curve performs generally better than Z-Curve, they are both doing bad since they do not take partition area into account in their optimization criteria. Specially, <xref ref-type="fig" rid="F8">Figure 8B</xref> strongly validates the advantages of R*-Grove in non-point datasets. <xref ref-type="fig" rid="F7">Figures 7C</xref>, <xref ref-type="fig" rid="F8">8C</xref> report the total margin for the same experiment. R*-Grove is the clear winner because it inherits the splitting mechanism of R*-Tree, which is the only one among all those that tries to produce square-like partitions. As the input size increases, more partitions are generated which causes the total margin to increase.</p></sec>
<sec>
<title>6.4.2. Block Utilization</title>
<p><xref ref-type="fig" rid="F7">Figures 7D</xref>, <xref ref-type="fig" rid="F8">8D</xref> show the block utilization as the input size increases. R*-Grove outperforms other partitioning techniques due to the proposed improvements in sections 4.2 and 4.3 specifically improve block utilization. Using R*-Grove, each partition almost occupies a full block in HDFS which increases the overall block utilization. Z-Curve and H-Curve perform similarly since they produce equi-sized partition by creating split points along the curve. The high variability of the Kd-tree is due to the way it partitions the space at each iteration. Since it always partitions the space along the median, it only works perfectly if the number of partitions is a power of two; otherwise, it could be very inefficient. This occasionally results in partitions of high block utilization but they could be highly variable in size.</p></sec>
<sec>
<title>6.4.3. Load Balance</title>
<p><xref ref-type="fig" rid="F7">Figures 7E</xref>, <xref ref-type="fig" rid="F8">8E</xref> show the standard deviation of partition size in MB for the <monospace>OSM-Nodes</monospace> and <monospace>OSM-Objects</monospace> datasets, respectively. Note that the HDFS block size is set to 128 MB. A smaller standard deviation indicates a better load balance. In <xref ref-type="fig" rid="F7">Figure 7E</xref>, the dataset <monospace>OSM-Nodes</monospace> contains records of almost the same size so R*-Grove performs only slightly better than Z-Curve, H-Curve, and STR even though these three techniques try to primarily balance the partition sizes. In <xref ref-type="fig" rid="F8">Figure 8E</xref>, the <monospace>OSM-Objects</monospace> dataset contains highly variable record sizes. In this case, R*-Grove is way better than all other techniques as it is the only one that employs the storage histogram to balance variable size records. In particular, we observe that the standard deviation of partition size on STR, Kd-Tree, Z-Curve, and H-Curve is about 50&#x02013;60% of the HDFS block size. Meanwhile, R*-Grove maintains a value around 10 MB, which is only 8% of the block size.</p></sec>
<sec>
<title>6.4.4. Effect of Sampling Ratio</title>
<p>Since the proposed R*-Grove follows the <italic>sampling-based</italic> partitioning mechanism, a valid question is how the sampling ratio affects partition quality and performance? In this experiment, we execute several partitioning operations using R*-Grove in <monospace>OSM-Objects</monospace> datasets. All the partitioning parameters are kept fixed, except the sampling ratio, which is varying from 0.001 to 3%. For each sampling ratio value, we execute the partition operation three times, then compute the average and standard deviation of quality measures and partition construction time. Partition construction is the process that compute partition MBRs from the sample. <xref ref-type="fig" rid="F9">Figure 9</xref> uses the average values to plot the line and the standard deviation for the error bars. First, <xref ref-type="fig" rid="F9">Figure 9A</xref> shows that the higher sampling ratio requires higher time for the partition construction process. This is expected due to the number of sample records which the partitioner has to use to compute partition MBRs. <xref ref-type="fig" rid="F9">Figures 9B&#x02013;E</xref> show the downward trend of total area, total margin, total overlap, and standard deviation of partition size. <xref ref-type="fig" rid="F9">Figure 9F</xref> shows the upward trend of block utilization when the sampling ratio increases. In addition, the standard deviation of small sampling ratios is much higher than that for high sampling ratios. These results indicates that the higher sampling ratios promise better partition quality. However, an important observation is that the partition quality measures start stabilizing for sampling ratios larger than 1%. This behavior was also validated in a previous work (Eldawy et al., <xref ref-type="bibr" rid="B9">2015a</xref>). In short, this work shows that a sample ratio of 1% dataset is enough to achieve virtually a same partition quality as sample ratio 100%. In the following experiments, we choose 1% as the default sampling ratio for all partitioning techniques.</p>
<fig id="F9" position="float">
<label>Figure 9</label>
<caption><p>Indexing performance and partition quality of R*-Grove in <monospace>OSM-Objects</monospace> datasets with different sampling ratios. <bold>(A)</bold> Partition construction time, <bold>(B)</bold> Total area, <bold>(C)</bold> Total margin, <bold>(D)</bold> Total overlap, <bold>(E)</bold> Load balance, <bold>(F)</bold> Block utilization.</p></caption>
<graphic xlink:href="fdata-03-00028-g0009.tif"/>
</fig></sec>
<sec>
<title>6.4.5. Effect of Minimum Split Ratio</title>
<p>In section 4.1, we introduced parameter &#x003C1;, namely minimum splitting ratio, to speed up the running time of <sc>SplitNode</sc> algorithm used in Phase 2, boundary computation. In this experiment, we verify how the minimum splitting ratio impacts the partition quality and performance. We also use <monospace>OSM-Objects</monospace> dataset with R*-Grove partitioning as the previous experiment in section 6.4.4. We vary &#x003C1; from 0 to 0.45. <xref ref-type="fig" rid="F10">Figure 10</xref> shows the overview of the experimental results. First, <xref ref-type="fig" rid="F10">Figure 10A</xref> shows that the running time of Phase 2, boundary computation, decreases as &#x003C1; increases which is expected due to the balanced splitting in the recursive algorithm which causes it to terminate earlier. According to the run-time analysis in section 4.1, a larger value of &#x003C1; reduces the depth of the recursive formula which results in a lower running time. However, this minimum splitting ratio also shrinks the search space for optimal partitioning scheme. Fortunately, the number of records in the 1% sample is usually large enough such that the boundary computation algorithm could still find a good partitioning scheme even for high value of &#x003C1;. In the following experiments, we choose &#x003C1; &#x0003D; 0.4 as the default value for R*-Grove partitioning.</p>
<fig id="F10" position="float">
<label>Figure 10</label>
<caption><p>Indexing performance and partition quality of R*-Grove in <monospace>OSM-Objects</monospace> datasets with different minimum splitting ratios. <bold>(A)</bold> Partition construction time, <bold>(B)</bold> Total area, <bold>(C)</bold> Total margin, <bold>(D)</bold> Total overlap, <bold>(E)</bold> Load balance, <bold>(F)</bold> Block utilization.</p></caption>
<graphic xlink:href="fdata-03-00028-g0010.tif"/>
</fig></sec></sec>
<sec>
<title>6.5. Spatial Query Performance</title>
<sec>
<title>6.5.1. Range Query</title>
<p><xref ref-type="fig" rid="F7">Figure 7F</xref> shows the performance of range query on the <monospace>OSM-Nodes</monospace> dataset with size 200 GB. For partitioned <monospace>OSM-Nodes</monospace> dataset, we run a number of range queries (from 200 to 1, 200) all with the same range query size which is 0.01% of the area covered by the entire input. All the queries are sent in one batch to run in parallel to put the cluster at full utilization. It is clear that R*-Grove outperforms all other techniques, especially when we run a large number of queries. This is the result of the high-quality and load-balanced partitions which minimize the number of blocks needed to process for each query. <xref ref-type="fig" rid="F8">Figure 8F</xref> shows the average cost of a range query on the <monospace>OSM-Objects</monospace> dataset in terms of number of blocks that need to be processed, the lower the better. This value is also computed for a range query with size 0.01% of space area. This result further confirms that R*-Grove provide a better query performance for variable-size records datasets.</p></sec>
<sec>
<title>6.5.2. Spatial Join</title>
<p>In this experiment, we split <monospace>OSM-Parks</monospace> and <monospace>OSM-Roads</monospace> datasets to get multiple datasets as follows: <monospace>Parks1</monospace>, <monospace>Park2</monospace> with sizes 3.6 and 7.2 GB; <monospace>Roads1</monospace> and <monospace>Roads2</monospace> with sizes 10 and 20 GB, respectively. This allows us to study the effect of the input size on the spatial join query while keeping the input data characteristics the same, i.e., distribution and geometry size. We compare to STR since it is the best competitor of R*-Grove in previous experiments. <xref ref-type="fig" rid="F11">Figure 11</xref> shows the performance of the spatial join query. In general, R*-Grove significantly outperforms STR in all query instances.</p>
<fig id="F11" position="float">
<label>Figure 11</label>
<caption><p>Spatial join performance in R*-Grove and STR partitioning. <bold>(A)</bold> Number of processing blocks, <bold>(B)</bold> Running time in seconds.</p></caption>
<graphic xlink:href="fdata-03-00028-g0011.tif"/>
</fig>
<p><xref ref-type="fig" rid="F11">Figure 11A</xref> shows the number of accessed blocks for each spatial join query over the datasets which are partitioned by R*-Grove and STR. We can notice that R*-Grove needs to access 40&#x02013;60% fewer blocks than STR for two reasons. First, the better load balance in R*-Grove reduces the overall number of blocks in each dataset. Second, the higher partition quality in R*-Grove results in fewer overlapping partitions between the two datasets. The number of accessed blocks is an indicator to estimate the actual performance of spatial join queries. Indeed, this is further verified in <xref ref-type="fig" rid="F11">Figure 11B</xref>, which shows actual running time for those queries. As we described, STR does not produce high quality partitions, thus the compound effect will even make it worst for spatial join query, which always relates to multiple STR partitioned datasets. On the other hand, R*-Grove addresses the limitations of STR so it can significantly improve the performance of spatial join query.</p></sec></sec>
<sec>
<title>6.6. Performance on Larger Datasets and Multi-Dimensional Data</title>
<sec>
<title>6.6.1. Scalability</title>
<p><xref ref-type="fig" rid="F12">Figure 12</xref> shows the indexing time for two-dimensional <monospace>OSM-Nodes</monospace> dataset with sizes 100, 200, 300, and 500 GB. We executed the same indexing jobs in both Spark and Hadoop to see how the processing model affects the indexing performance. We observed that Spark outperforms Hadoop in terms of total indexing time. This experiment also demonstrates that R*-Grove is ready to work with large volume datasets on both Hadoop and Spark. We also observe that the gap between Hadoop and Spark decreases as the input size increases as Spark starts to spill more data to disk.</p>
<fig id="F12" position="float">
<label>Figure 12</label>
<caption><p>The scalability of R*-Grove partitioning in Spark and Hadoop.</p></caption>
<graphic xlink:href="fdata-03-00028-g0012.tif"/>
</fig></sec>
<sec>
<title>6.6.2. Multi-Dimensional Datasets</title>
<p>In this experiment, we study the quality of R*-Grove on multi-dimensional datasets. Inspired by Beckmann and Seeger (<xref ref-type="bibr" rid="B3">2008</xref>), we use four <monospace>synthetic</monospace> datasets with number of dimensions 3, 4, 5, and 9. We measure the running time and the quality of the five partitioning techniques: R*-Grove, STR, Kd-Tree, Z-Curve, and H-Curve. <xref ref-type="fig" rid="F13">Figure 13A</xref> shows that R*-Grove is mostly the fastest technique to index the input dataset due to the best load balance among partitions. <xref ref-type="fig" rid="F13">Figure 13B</xref> shows that R*-Grove significantly reduces total area of partitions. <xref ref-type="fig" rid="F13">Figure 13C</xref> shows the total margin of all the techniques. While the total margin varies with the number of dimensions since they are different datasets, the techniques maintain the same order in terms of quality from best to worst, i.e., R*-Grove, Z-Curve, Kd-tree, STR, and H-Curve, except the last group, where H-Curve is better than STR. This experiment indicates that R*-Grove could maintain its characteristics for multi-dimensional datasets. <xref ref-type="fig" rid="F13">Figures 13D,E</xref> report the block utilization and standard deviation of partition size, respectively. R*-Grove is the best technique that keeps both measures good. <xref ref-type="fig" rid="F13">Figure 13F</xref> depicts the normalized range query performance of different techniques, which affirms the advantages of R*-Grove. Notice that this is the only experiment where Z-Curve performs better than H-Curve. The reason is that the generated points are generated close to a diagonal line in the <italic>d</italic>-dimension. Since the Z-Curve just interleaves the bits of all dimensions, it will result in sorting these points along the diagonal line which results in a good partitioning. However, the way H-Curve rotates the space with each level will cause it to jump across the diagonal.</p>
<fig id="F13" position="float">
<label>Figure 13</label>
<caption><p>Indexing performance and partition quality of R*-Grove and other partitioning techniques on <monospace>synthetic</monospace> multi-dimensional dataset. <bold>(A)</bold> Partitioning time, <bold>(B)</bold> Total volume, <bold>(C)</bold> Total margin, <bold>(D)</bold> Block utilization, <bold>(E)</bold> Load balance, <bold>(F)</bold> Range query performance.</p></caption>
<graphic xlink:href="fdata-03-00028-g0013.tif"/>
</fig>
<p>Additionally, STR becomes very bad as the number dimensions increases. This can be explained by the way STR computes the number of partitions given a sample data points. The existing STR implementation always creates a tree with a fixed node degree <italic>n</italic> and <italic>d</italic> levels where <italic>d</italic> is the number of dimensions. This configuration results in <italic>n</italic><sup><italic>d</italic></sup> leaf nodes or partitions. It computes the node degree <italic>n</italic> as the smallest integer that satisfies <italic>n</italic><sup><italic>d</italic></sup> &#x02265; <italic>P</italic> where <italic>P</italic> is the number of desired partitions. For example, for an input dataset of 100 GB, <italic>d</italic> &#x0003D; 9 dimensions, and a block size of <italic>B</italic> &#x0003D; 128 MB, the number of desired partitions <italic>P</italic> &#x0003D; 100&#x000B7;1, 024/128 &#x0003D; 800 partitions and <italic>n</italic> &#x0003D; 3. This results in a total of 3<sup>9</sup> &#x0003D; 19, 683 partitions. Obviously, as <italic>d</italic> increases, the gap between the ideal number of partitions <italic>P</italic> and the actual number of partitions <italic>n</italic><sup><italic>d</italic></sup> increases which results in a very poor block utilization as shown in this experiment. Finally, <xref ref-type="fig" rid="F13">Figure 13F</xref> shows the average cost of a range query in terms of number of processed blocks, which indicates that R*-Grove is the winner when we want to speed up spatial query processing.</p>
<p>To further support our findings, we also execute similar experiment on <monospace>NYC-Taxi</monospace> dataset, which contains up to seven dimensions as follows: <italic>pickup</italic>_<italic>latitude</italic>, <italic>pickup</italic>_<italic>longitude</italic>, <italic>dropoff</italic>_<italic>latitude</italic>, <italic>dropoff</italic>_<italic>longitude</italic>, <italic>pickup</italic>_<italic>datetime</italic>, <italic>trip</italic>_<italic>time</italic>_<italic>in</italic>_<italic>secs</italic>, <italic>trip</italic>_<italic>distance</italic>. These attribute values are normalized in order to avoid the dominance of some columns. We decide to partition this dataset using multiple attributes which is picked in the aformentioned order with size 4, 5, and 7. <xref ref-type="fig" rid="F14">Figure 14</xref> shows that R*-Grove balances all the different quality metrics. Specially, <xref ref-type="fig" rid="F14">Figure 14F</xref> indicates that R*-Grove is the winner when compared to other techniques in terms of spatial query performance. We also notice that H-Curve performs better than Z-Curve with this real dataset. We conclude that R*-Grove is a better option for indexing multi-dimensional spatial data since it outperforms or got an equivalent performance with other indexes in all metrics.</p>
<fig id="F14" position="float">
<label>Figure 14</label>
<caption><p>Indexing performance and partition quality of R*-Grove and other partitioning techniques on multi-dimensional <monospace>NYC-Taxi</monospace> dataset. <bold>(A)</bold> Partitioning time, <bold>(B)</bold> Total volume, <bold>(C)</bold> Total margin, <bold>(D)</bold> Block utilization, <bold>(E)</bold> Load balance, <bold>(F)</bold> Range query performance.</p></caption>
<graphic xlink:href="fdata-03-00028-g0014.tif"/>
</fig></sec></sec></sec>
<sec sec-type="conclusions" id="s7">
<title>7. Conclusion</title>
<p>This paper proposes R*-Grove, a novel partitioning technique which can be widely used in many big spatial data processing systems. We highlighted three limitations in existing partitioning techniques such as STR, Kd-Tree, Z-Curve, and Hilbert Curve. These limitations are the low quality of the partitions, the imbalance among partitions, and the failure to handle variable-size records. We showed that R*-Grove overcomes these three limitations to produce high quality partitions. We showed three case studies in which R*-Grove can be used to facilitate big spatial indexing, range query, and spatial join. An extensive experimental evaluation was carried out on big spatial datasets and showed that R*-Grove is scalable and speeds up all the operations in the case studies. We believe that R*-Grove promises to be a good replacement to existing big spatial data partitioning techniques in many systems. In the future, we will further study the proposed technique for in-memory and streaming applications to see how it behaves under these architectures.</p></sec>
<sec sec-type="data-availability-statement" id="s8">
<title>Data Availability Statement</title>
<p>The datasets generated for this study are available on the UCR Spatio-temporal Active Repository (UCR-STAR, <ext-link ext-link-type="uri" xlink:href="https://star.cs.ucr.edu/">https://star.cs.ucr.edu/</ext-link>) or on request to the corresponding author. In particular, we used <monospace>OSM2015/all_nodes</monospace>, <monospace>OSM2015/roads</monospace>, <monospace>OSM2015/parks</monospace>, <monospace>OSM2015/all_objects</monospace>, <monospace>NYCTaxi</monospace>. For the <monospace>diagonal</monospace><monospace> points</monospace> dataset, we generated them using the spatial data generator (Vu et al., <xref ref-type="bibr" rid="B38">2019</xref>) with following parameters: dataset size |<italic>D</italic>| = 80 million points; number of dimensions <italic>d</italic> = 3, 4, 5, 9; the percentage (ratio) of the points that are exactly on the line <italic>perc</italic> = 0.05; the size of the buffer around the line where additional points are scattered <italic>buf</italic> = 0.1.</p></sec>
<sec id="s9">
<title>Author Contributions</title>
<p>AE and TV worked on the theoretical proofs, the design, and implementation of the algorithms. TV wrote the manuscript and carried out the experimental evaluation with the guidance of AE. All authors contributed to the article and approved the submitted version.</p></sec>
<sec id="s10">
<title>Conflict of Interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p></sec>
</body>
<back>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="web"><person-group person-group-type="author"><collab>allobjects</collab></person-group> (<year>2019</year>). <source>Openstreetmap All Objects Dataset</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="http://star.cs.ucr.edu/&#x00023;dataset=OSM2015/all_objects">http://star.cs.ucr.edu/&#x00023;dataset=OSM2015/all_objects</ext-link></citation>
</ref>
<ref id="B2">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Beckmann</surname> <given-names>N.</given-names></name> <name><surname>Kriegel</surname> <given-names>H.</given-names></name> <name><surname>Schneider</surname> <given-names>R.</given-names></name> <name><surname>Seeger</surname> <given-names>B.</given-names></name></person-group> (<year>1990</year>). <article-title>The R*-tree: an efficient and robust access method for points and rectangles</article-title>, in <source>SIGMOD</source> (<publisher-loc>Atlantic City, NJ</publisher-loc>), <fpage>322</fpage>&#x02013;<lpage>331</lpage>. <pub-id pub-id-type="doi">10.1145/93597.98741</pub-id></citation>
</ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Beckmann</surname> <given-names>N.</given-names></name> <name><surname>Seeger</surname> <given-names>B.</given-names></name></person-group> (<year>2008</year>). A benchmark for multidimensional index Structures.</citation>
</ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Beckmann</surname> <given-names>N.</given-names></name> <name><surname>Seeger</surname> <given-names>B.</given-names></name></person-group> (<year>2009</year>). <article-title>A revised R*-tree in comparison with related index structures</article-title>, in <source>SIGMOD</source> (<publisher-loc>Providence, RI</publisher-loc>), <fpage>799</fpage>&#x02013;<lpage>812</lpage>. <pub-id pub-id-type="doi">10.1145/1559845.1559929</pub-id></citation>
</ref>
<ref id="B5">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bentley</surname> <given-names>J. L.</given-names></name></person-group> (<year>1975</year>). <article-title>Multidimensional binary search trees used for associative searching</article-title>. <source>Commun. ACM</source> <volume>18</volume>, <fpage>509</fpage>&#x02013;<lpage>517</lpage>. <pub-id pub-id-type="doi">10.1145/361002.361007</pub-id></citation>
</ref>
<ref id="B6">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Chasparis</surname> <given-names>H.</given-names></name> <name><surname>Eldawy</surname> <given-names>A.</given-names></name></person-group> (<year>2017</year>). <article-title>Experimental evaluation of selectivity estimation on big spatial data</article-title>, in <source>Proceedings of the Fourth International ACM Workshop on Managing and Mining Enriched Geo-Spatial Data</source> (<publisher-loc>Chicago, IL</publisher-loc>), <volume>8</volume>:<fpage>1</fpage>&#x02013;<lpage>8</lpage>:6.</citation>
</ref>
<ref id="B7">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Dittrich</surname> <given-names>J.</given-names></name> <name><surname>Seeger</surname> <given-names>B.</given-names></name></person-group> (<year>2000</year>). <article-title>Data redundancy and duplicate detection in spatial join processing</article-title>, in <source>Proceedings of the 16th International Conference on Data Engineering</source> (<publisher-loc>San Diego, CA</publisher-loc>), <fpage>535</fpage>&#x02013;<lpage>546</lpage>. <pub-id pub-id-type="doi">10.1109/ICDE.2000.839452</pub-id></citation>
</ref>
<ref id="B8">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name></person-group> (<year>2017</year>). <article-title>Sphinx: empowering impala for efficient execution of SQL queries on big spatial data</article-title>, in <source>SSTD</source> (<publisher-loc>Arlington, VA</publisher-loc>), <fpage>65</fpage>&#x02013;<lpage>83</lpage>. <pub-id pub-id-type="doi">10.1007/978-3-319-64367-0_4</pub-id></citation>
</ref>
<ref id="B9">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Alarabi</surname> <given-names>L.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name></person-group> (<year>2015a</year>). <article-title>Spatial partitioning techniques in spatial hadoop</article-title>. <source>PVLDB</source> <volume>8</volume>, <fpage>1602</fpage>&#x02013;<lpage>1605</lpage>. <pub-id pub-id-type="doi">10.14778/2824032.2824057</pub-id></citation>
</ref>
<ref id="B10">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Li</surname> <given-names>Y.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name> <name><surname>Janardan</surname> <given-names>R.</given-names></name></person-group> (<year>2013</year>). <article-title>Cg_hadoop: computational geometry in mapreduce</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Orlando, FL</publisher-loc>), <fpage>284</fpage>&#x02013;<lpage>293</lpage>. <pub-id pub-id-type="doi">10.1145/2525314.2525349</pub-id></citation>
</ref>
<ref id="B11">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name></person-group> (<year>2015</year>). <article-title>Spatialhadoop: a mapreduce framework for spatial data</article-title>, in <source>ICDE</source> (<publisher-loc>Seoul</publisher-loc>), <fpage>1352</fpage>&#x02013;<lpage>1363</lpage>. <pub-id pub-id-type="doi">10.1109/ICDE.2015.7113382</pub-id></citation>
</ref>
<ref id="B12">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name></person-group> (<year>2016</year>). <article-title>The era of big spatial data: a survey</article-title>. <source>Found. Trends Databases</source> <volume>6</volume>, <fpage>163</fpage>&#x02013;<lpage>273</lpage>. <pub-id pub-id-type="doi">10.1561/9781680832259</pub-id></citation>
</ref>
<ref id="B13">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name> <name><surname>Al-Harthi</surname> <given-names>S.</given-names></name> <name><surname>Alzaidy</surname> <given-names>A.</given-names></name> <name><surname>Tarek</surname> <given-names>K.</given-names></name> <name><surname>Ghani</surname> <given-names>S.</given-names></name></person-group> (<year>2015b</year>). <article-title>SHAHED: A mapreduce-based system for querying and visualizing spatio-temporal satellite data</article-title>, in <source>ICDE</source> (<publisher-loc>Seoul</publisher-loc>), <fpage>1585</fpage>&#x02013;<lpage>1596</lpage>. <pub-id pub-id-type="doi">10.1109/ICDE.2015.7113427</pub-id></citation>
</ref>
<ref id="B14">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name> <name><surname>Jonathan</surname> <given-names>C.</given-names></name></person-group> (<year>2016</year>). <article-title>Hadoopviz: A mapreduce framework for extensible visualization of big spatial data</article-title>, in <source>ICDE</source> (<publisher-loc>Helsinki</publisher-loc>), <fpage>601</fpage>&#x02013;<lpage>612</lpage>. <pub-id pub-id-type="doi">10.1109/ICDE.2016.7498274</pub-id></citation>
</ref>
<ref id="B15">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Fox</surname> <given-names>A. D.</given-names></name> <name><surname>Eichelberger</surname> <given-names>C. N.</given-names></name> <name><surname>Hughes</surname> <given-names>J. N.</given-names></name> <name><surname>Lyon</surname> <given-names>S.</given-names></name></person-group> (<year>2013</year>). <article-title>Spatio-temporal indexing in non-relational distributed databases</article-title>, in <source>Big Data</source> (<publisher-loc>Santa Clara, CA</publisher-loc>), <fpage>291</fpage>&#x02013;<lpage>299</lpage>. <pub-id pub-id-type="doi">10.1109/BigData.2013.6691586</pub-id></citation>
</ref>
<ref id="B16">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Ghosh</surname> <given-names>S.</given-names></name> <name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Jais</surname> <given-names>S.</given-names></name></person-group> (<year>2019</year>). <article-title>Aid: An adaptive image data index for interactive multilevel visualization</article-title>, in <source>ICDE</source> (<publisher-loc>Macau</publisher-loc>). <pub-id pub-id-type="doi">10.1109/ICDE.2019.00150</pub-id></citation>
</ref>
<ref id="B17">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Goodchild</surname> <given-names>M. F.</given-names></name></person-group> (<year>2007</year>). <article-title>Citizens as voluntary sensors: Spatial data infrastructure in the world of web 2.0</article-title>. <source>IJSDIR</source> <volume>2</volume>, <fpage>24</fpage>&#x02013;<lpage>32</lpage>.</citation>
</ref>
<ref id="B18">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Guttman</surname></name> <name><surname>Bughin</surname> <given-names>J.</given-names></name> <name><surname>Chui</surname> <given-names>M.</given-names></name> <name><surname>Manyika</surname> <given-names>J.</given-names></name> <name><surname>Saleh</surname> <given-names>T.</given-names></name> <name><surname>Wiseman</surname> <given-names>B. A</given-names></name></person-group>. (<year>1984</year>). <article-title>R-trees: A dynamic index structure for spatial searching</article-title>, in <source>SIGMOD</source> (<publisher-loc>Boston, MA</publisher-loc>), <fpage>47</fpage>&#x02013;<lpage>57</lpage>. <pub-id pub-id-type="doi">10.1145/602259.602266</pub-id></citation>
</ref>
<ref id="B19">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Henke</surname> <given-names>N.</given-names></name> <name><surname>Bughin</surname> <given-names>J.</given-names></name> <name><surname>Chui</surname> <given-names>M.</given-names></name> <name><surname>Manyika</surname> <given-names>J.</given-names></name> <name><surname>Saleh</surname> <given-names>T.</given-names></name> <name><surname>Wiseman</surname> <given-names>B.</given-names></name> <etal/></person-group>. (<year>2016</year>). <source>The Age of Analytics: Competing in a Data-Driven World</source>. <publisher-name>Technical Report, McKinsey Global Institute</publisher-name>.</citation>
</ref>
<ref id="B20">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Hoel</surname> <given-names>E. G.</given-names></name> <name><surname>Samet</surname> <given-names>H.</given-names></name></person-group> (<year>1994</year>). <article-title>Performance of data-parallel spatial operations</article-title>, in <source>VLDB&#x00027;94, Proceedings of 20th International Conference on Very Large Data Bases</source> (<publisher-loc>Santiago de Chile</publisher-loc>), <fpage>156</fpage>&#x02013;<lpage>167</lpage>.</citation>
</ref>
<ref id="B21">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jacox</surname> <given-names>E. H.</given-names></name> <name><surname>Samet</surname> <given-names>H.</given-names></name></person-group> (<year>2007</year>). <article-title>Spatial join techniques</article-title>. <source>ACM Trans. Database Syst</source>. <volume>32</volume>:<fpage>7</fpage>. <pub-id pub-id-type="doi">10.1145/1206049.1206056</pub-id></citation>
</ref>
<ref id="B22">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Kamel</surname> <given-names>I.</given-names></name> <name><surname>Faloutsos</surname> <given-names>C.</given-names></name></person-group> (<year>1994</year>). <article-title>Hilbert R-tree: an improved r-tree using fractals</article-title>, in <source>VLDB</source> (<publisher-loc>Santiago de Chile</publisher-loc>), <fpage>500</fpage>&#x02013;<lpage>509</lpage>.</citation>
</ref>
<ref id="B23">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname> <given-names>D.-T.</given-names></name> <name><surname>Wong</surname> <given-names>C.</given-names></name></person-group> (<year>1977</year>). <article-title>Worst-case analysis for region and partial region searches in multidimensional binary search trees and balanced quad trees</article-title>. <source>Acta Inform</source>. <volume>9</volume>, <fpage>23</fpage>&#x02013;<lpage>29</lpage>. <pub-id pub-id-type="doi">10.1007/BF00263763</pub-id></citation>
</ref>
<ref id="B24">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname> <given-names>T.</given-names></name> <name><surname>Lee</surname> <given-names>S.</given-names></name></person-group> (<year>2003</year>). <article-title>Omt: Overlap minimizing top-down bulk loading algorithm for R-tree</article-title>, in <source>CAISE Short Paper Proceedings</source>, <volume>Vol. 74</volume>, <fpage>69</fpage>&#x02013;<lpage>72</lpage>.</citation>
</ref>
<ref id="B25">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Leutenegger</surname> <given-names>S. T.</given-names></name> <name><surname>Lopez</surname> <given-names>M. A.</given-names></name> <name><surname>Edgington</surname> <given-names>J.</given-names></name></person-group> (<year>1997</year>). <article-title>STR: A simple and efficient algorithm for r-tree packing</article-title>, in <source>ICDE</source> (<publisher-loc>Birmingham</publisher-loc>), <fpage>497</fpage>&#x02013;<lpage>506</lpage>. <pub-id pub-id-type="doi">10.1109/ICDE.1997.582015</pub-id></citation>
</ref>
<ref id="B26">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Li</surname> <given-names>Y.</given-names></name> <name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Xue</surname> <given-names>J.</given-names></name> <name><surname>Knorozova</surname> <given-names>N.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name> <name><surname>Janardan</surname> <given-names>R.</given-names></name></person-group> (<year>2019</year>). <article-title>Scalable computational geometry in MapReduce</article-title>. <source>VLDB J</source>. <volume>28</volume>, <fpage>523</fpage>&#x02013;<lpage>548</lpage>. <pub-id pub-id-type="doi">10.1007/s00778-018-0534-5</pub-id></citation>
</ref>
<ref id="B27">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Lo</surname> <given-names>M.</given-names></name> <name><surname>Ravishankar</surname> <given-names>C. V.</given-names></name></person-group> (<year>1994</year>). <article-title>Spatial joins using seeded trees</article-title>, in <source>SIGMOD</source> (<publisher-loc>Minneapolis, MN</publisher-loc>), <fpage>209</fpage>&#x02013;<lpage>220</lpage>. <pub-id pub-id-type="doi">10.1145/191839.191881</pub-id></citation>
</ref>
<ref id="B28">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lu</surname> <given-names>P.</given-names></name> <name><surname>Chen</surname> <given-names>G.</given-names></name> <name><surname>Ooi</surname> <given-names>B.</given-names></name> <name><surname>Vo</surname> <given-names>H.</given-names></name> <name><surname>Wu</surname> <given-names>S.</given-names></name></person-group> (<year>2014</year>). <article-title>ScalaGiST: scalable generalized search trees for MapReduce systems</article-title>. <source>PVLDB</source>, <volume>7</volume>, <fpage>1797</fpage>&#x02013;<lpage>1808</lpage>. <pub-id pub-id-type="doi">10.14778/2733085.2733087</pub-id></citation>
</ref>
<ref id="B29">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Magdy</surname> <given-names>A.</given-names></name> <name><surname>Alarabi</surname> <given-names>L.</given-names></name> <name><surname>Al-Harthi</surname> <given-names>S.</given-names></name> <name><surname>Musleh</surname> <given-names>M.</given-names></name> <name><surname>Ghanem</surname> <given-names>T. M.</given-names></name> <name><surname>Ghani</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2014</year>). <article-title>Taghreed: a system for querying, analyzing, and visualizing geotagged microblogs</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Dallas, TX; Fort Worth, TX</publisher-loc>), <fpage>163</fpage>&#x02013;<lpage>172</lpage>. <pub-id pub-id-type="doi">10.1145/2666310.2666397</pub-id></citation>
</ref>
<ref id="B30">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Nishimura</surname> <given-names>S.</given-names></name> <name><surname>Das</surname> <given-names>S.</given-names></name> <name><surname>Agrawal</surname> <given-names>D.</given-names></name> <name><surname>El Abbadi</surname> <given-names>A.</given-names></name></person-group> (<year>2013</year>). <article-title>MD-hbase: design and implementation of an elastic data infrastructure for cloud-scale location services</article-title>. <source>Distrib. Parallel Databases</source> <volume>31</volume>, <fpage>289</fpage>&#x02013;<lpage>319</lpage>. <pub-id pub-id-type="doi">10.1007/s10619-012-7109-z</pub-id></citation>
</ref>
<ref id="B31">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Sabek</surname> <given-names>I.</given-names></name> <name><surname>Mokbel</surname> <given-names>M. F.</given-names></name></person-group> (<year>2017</year>). <article-title>On spatial joins in mapreduce</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Redondo Beach, CA</publisher-loc>), <volume>21</volume>:<fpage>1</fpage>&#x02013;<lpage>21</lpage>:10. <pub-id pub-id-type="doi">10.1145/3139958.3139967</pub-id></citation>
</ref>
<ref id="B32">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Samet</surname> <given-names>H.</given-names></name></person-group> (<year>1984</year>). <article-title>The quadtree and related hierarchical data structures</article-title>. <source>ACM Comput. Surveys</source> <volume>16</volume>, <fpage>187</fpage>&#x02013;<lpage>260</lpage>. <pub-id pub-id-type="doi">10.1145/356924.356930</pub-id></citation>
</ref>
<ref id="B33">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Siddique</surname> <given-names>A. B.</given-names></name> <name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Hristidis</surname> <given-names>V.</given-names></name></person-group> (<year>2019</year>). <article-title>Comparing synopsis techniques for approximate spatial data analysis</article-title>. <source>Proc. VLDB Endow</source>. <volume>12</volume>, <fpage>1583</fpage>&#x02013;<lpage>1596</lpage>. <pub-id pub-id-type="doi">10.14778/3342263.3342635</pub-id></citation>
</ref>
<ref id="B34">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Tang</surname> <given-names>M.</given-names></name> <name><surname>Yu</surname> <given-names>Y.</given-names></name> <name><surname>Malluhi</surname> <given-names>Q. M.</given-names></name> <name><surname>Ouzzani</surname> <given-names>M.</given-names></name> <name><surname>Aref</surname> <given-names>W. G.</given-names></name></person-group> (<year>2016</year>). <article-title>LocationSpark: a distributed in-memory data management system for big spatial data</article-title>. <source>PVLDB</source> <volume>9</volume>, <fpage>1565</fpage>&#x02013;<lpage>1568</lpage>. <pub-id pub-id-type="doi">10.14778/3007263.3007310</pub-id></citation>
</ref>
<ref id="B35">
<citation citation-type="web"><person-group person-group-type="author"><collab>UCRSTAR</collab></person-group> (<year>2019</year>). <source>The UCR Spatio-Temporal Active Repository (UCR-STAR)</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://star.cs.ucr.edu/">https://star.cs.ucr.edu/</ext-link></citation>
</ref>
<ref id="B36">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Vo</surname> <given-names>H.</given-names></name> <name><surname>Aji</surname> <given-names>A.</given-names></name> <name><surname>Wang</surname> <given-names>F.</given-names></name></person-group> (<year>2014</year>). <article-title>SATO: a spatial data partitioning framework for scalable query processing</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Dallas, TX; Fort Worth, TX</publisher-loc>), <fpage>545</fpage>&#x02013;<lpage>548</lpage>. <pub-id pub-id-type="doi">10.1145/2666310.2666365</pub-id></citation>
</ref>
<ref id="B37">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Vu</surname> <given-names>T.</given-names></name> <name><surname>Eldawy</surname> <given-names>A.</given-names></name></person-group> (<year>2018</year>). <article-title>R-Grove: growing a family of R-trees in the big-data forest</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Seattle, WA</publisher-loc>), <fpage>532</fpage>&#x02013;<lpage>535</lpage>. <pub-id pub-id-type="doi">10.1145/3274895.3274984</pub-id></citation>
</ref>
<ref id="B38">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vu</surname> <given-names>T.</given-names></name> <name><surname>Migliorini</surname> <given-names>S.</given-names></name> <name><surname>Eldawy</surname> <given-names>A.</given-names></name> <name><surname>Belussi</surname> <given-names>A.</given-names></name></person-group> (<year>2019</year>). <article-title>Spatial data generators</article-title>, in <source>1st ACM SIGSPATIAL International Workshop on Spatial Gems (SpatialGems 2019)</source>, <volume>7</volume>.</citation>
</ref>
<ref id="B39">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Whitman</surname> <given-names>R. T.</given-names></name> <name><surname>Park</surname> <given-names>M. B.</given-names></name> <name><surname>Ambrose</surname> <given-names>S. M.</given-names></name> <name><surname>Hoel</surname> <given-names>E. G.</given-names></name></person-group> (<year>2014</year>). <article-title>Spatial indexing and analytics on Hadoop</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Dallas, TX; Fort Worth, TX</publisher-loc>), <fpage>73</fpage>&#x02013;<lpage>82</lpage>. <pub-id pub-id-type="doi">10.1145/2666310.2666387</pub-id></citation>
</ref>
<ref id="B40">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Xie</surname> <given-names>D.</given-names></name> <name><surname>Li</surname> <given-names>F.</given-names></name> <name><surname>Yao</surname> <given-names>B.</given-names></name> <name><surname>Li</surname> <given-names>G.</given-names></name> <name><surname>Zhou</surname> <given-names>L.</given-names></name> <name><surname>Guo</surname> <given-names>M.</given-names></name></person-group> (<year>2016</year>). <article-title>Simba: Efficient in-memory spatial analytics</article-title>, in <source>SIGMOD</source> (<publisher-loc>San Francisco, CA</publisher-loc>), <fpage>1071</fpage>&#x02013;<lpage>1085</lpage>. <pub-id pub-id-type="doi">10.1145/2882903.2915237</pub-id></citation>
</ref>
<ref id="B41">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Yu</surname> <given-names>J.</given-names></name> <name><surname>Wu</surname> <given-names>J.</given-names></name> <name><surname>Sarwat</surname> <given-names>M.</given-names></name></person-group> (<year>2015</year>). <article-title>Geospark: a cluster computing framework for processing large-scale spatial data</article-title>, in <source>SIGSPATIAL</source> (<publisher-loc>Bellevue, WA</publisher-loc>), <volume>70</volume>:<fpage>1</fpage>&#x02013;<lpage>4</lpage>. <pub-id pub-id-type="doi">10.1145/2820783.2820860</pub-id></citation>
</ref>
<ref id="B42">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhou</surname> <given-names>X.</given-names></name> <name><surname>Abel</surname> <given-names>D. J.</given-names></name> <name><surname>Truffet</surname> <given-names>D.</given-names></name></person-group> (<year>1998</year>). <article-title>Data partitioning for parallel spatial join processing</article-title>. <source>GeoInformatica</source> <volume>2</volume>, <fpage>175</fpage>&#x02013;<lpage>204</lpage>. <pub-id pub-id-type="doi">10.1023/A:1009755931056</pub-id></citation>
</ref>
</ref-list>
<fn-group>
<fn fn-type="financial-disclosure"><p><bold>Funding.</bold> This work was supported in part by the National Science Foundation (NSF) under grants IIS-1838222 and CNS-1924694.</p>
</fn>
</fn-group>
</back>
</article> 