Skip to content

TreeIndexDB is an advanced database management system designed for efficient B+ Tree operations.

Notifications You must be signed in to change notification settings

skamble2/TreeIndexDB

Repository files navigation

TreeIndexDB

TreeIndexDB is an advanced database management system designed for efficient B+ Tree operations and comprehensive index management. This system is optimized for high performance, providing robust functionalities for creating, inserting, deleting, and finding records within a B+ Tree structure. It also offers powerful scanning capabilities, allowing users to traverse the tree in sorted order. TreeIndexDB integrates a full-featured index manager, facilitating the creation and maintenance of B+ Tree indexes, making it an ideal solution for applications that require fast, reliable access to large datasets.

Table of Contents

Features

  • Efficient B+ Tree Operations: Includes creation, insertion, deletion, and searching within B+ Trees.
  • Custom Node Management: Features custom functions for node splitting, merging, and redistribution.
  • Comprehensive Index Management: Initialize and manage B+ Tree indexes with ease.
  • Record Management: Efficient handling of records with functionalities to insert, delete, and update records.
  • Buffer Pool Management: Advanced buffer management with support for FIFO and LRU strategies.
  • Scanning Capabilities: Traverse and scan tree entries in sorted key order.

Installation

To install and set up TreeIndexDB, follow these steps:

  1. Clone the repository:

    git clone https://github.com/skamble2/TreeIndexDB.git
    cd TreeIndexDB
  2. Compile the code using make:

    make
  3. Run the program:

    make run
  4. Clean up binary files and objects:

    make clean

Usage

To use TreeIndexDB, follow the instructions below:

  • Open a terminal and navigate to the project directory.
  • Use the make command to compile the code.
  • Use the make run command to execute the program.
  • Use the make clean command to remove any compiled binaries and object files.

Functions Overview

B+ Tree Operations

  • createBtree(...): Initializes and creates a new B+ Tree.
  • openBtree(...): Opens an existing B+ Tree stored in a file.
  • closeBtree(...): Closes the B+ Tree, marking pages dirty and writing back to disk.
  • deleteBtree(...): Deletes the specified B+ Tree file.

Index Manager Functions

  • initIndexManager(...): Initializes the index manager and its resources.
  • shutdownIndexManager(...): Shuts down the index manager and frees resources.

Record Management

  • insertRecord(...): Inserts a new record into the B+ Tree.
  • deleteRecord(...): Deletes a record from the B+ Tree.
  • updateRecord(...): Updates an existing record in the B+ Tree.
  • getRecord(...): Retrieves a record from the B+ Tree.

Buffer Pool Management

  • initBufferPool(...): Initializes a buffer pool with a specified number of pages.
  • shutdownBufferPool(...): Closes the buffer pool and frees up resources.
  • forceFlushPool(...): Writes all dirty pages from the buffer pool to disk.
  • unpinPage(...): Unpins a page, allowing it to be flushed from memory.

Custom B+ Tree Functions

  • findLeaf(...): Finds the leaf node containing a specified key.
  • insertIntoLeaf(...): Inserts a new record pointer and key into a leaf.
  • insertIntoNode(...): Inserts a key and pointer into a non-leaf node.
  • adjustRoot(...): Adjusts the root after deletion to maintain B+ Tree properties.
  • deleteEntry(...): Deletes an entry from the B+ Tree and adjusts nodes accordingly.
  • findKey(...): Searches for a specified key in the B+ Tree.
  • openTreeScan(...): Initializes a scan to traverse entries in sorted order.
  • nextEntry(...): Retrieves the next entry in the scan.
  • closeTreeScan(...): Closes the scan and frees resources.

Contributors

About

TreeIndexDB is an advanced database management system designed for efficient B+ Tree operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published