skip to main content
article
Free Access

Time- and space-optimality in B-trees

Published:01 March 1981Publication History
Skip Abstract Section

Abstract

A B-tree is compact if it is minimal in number of nodes, hence has optimal space utilization, among equally capacious B-trees of the same order. The space utilization of compact B-trees is analyzed and compared with that of noncompact B-trees and with (node)-visit-optimal B-trees, which minimize the expected number of nodes visited per key access. Compact B-trees can be as much as a factor of 2.5 more space efficient than visit-optimal B-trees; and the node-visit cost of a compact tree is never more than 1 + the node-visit cost of an optimal tree. The utility of initializing a B-tree to be compact (which initialization can be done in time linear in the number of keys if the keys are presorted) is demonstrated by comparing the space utilization of a compact tree that has been augmented by random insertions with that of a tree that has been grown entirely by random insertions. Even after increasing the number of keys by a modest amount, the effects of compact initialization are still felt. Once the tree has grown so large that these effects are no longer discernible, the tree can be expeditiously compacted in place using an algorithm presented here; and the benefits of compactness resume.

References

  1. 1 BAYER, R., AND MCCREIGHT, E. Organization and maintenance of large ordered indexes. Acta Informatica 1, 3 (1972), 173-189.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 BAYER, R., AND UNTERAUER, K. Prefix B-trees. ACM Trans. Database Syst. 2, 1 (March 1977), 11-26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3 KNUTH, D.E. The Art of Computer Programming, vol. 3. Addison-Wesley, Reading, Mass., 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 MILLER, R.E., PIPPENGER, N., ROSENBERG, A.L., AND SNYDER, L. Optimal 2,3 trees. SIAM J. Cornput. 8, 1 (1979), 42-59.Google ScholarGoogle Scholar
  5. 5 ROSENBERG, A.L., AND SNYDER, L. Minimal comparison 2,3 trees. SIAM J. Comput. 7, 4 {1978), 465-480.Google ScholarGoogle ScholarCross RefCross Ref
  6. 6 SNYDER, L. On uniquely represented data structures. Proc. 18th Annu. Conf. Foundations of Computer Science, 1977, pp. 412-417.Google ScholarGoogle Scholar
  7. 7 YAO, A.C. On random 2,3 trees. Acta Informatica 9, 3 (1978), 159-170.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Time- and space-optimality in B-trees

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM Transactions on Database Systems
      ACM Transactions on Database Systems  Volume 6, Issue 1
      March 1981
      211 pages
      ISSN:0362-5915
      EISSN:1557-4644
      DOI:10.1145/319540
      Issue’s Table of Contents

      Copyright © 1981 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 March 1981
      Published in tods Volume 6, Issue 1

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader