GeorgeBerdovskiy / cowabunga

HTAP database written in Rust with Python bindings 🐮
Apache License 2.0
3 stars 0 forks source link

Add Indexing #13

Closed DrKlocekGit closed 9 months ago

DrKlocekGit commented 9 months ago

"The Index class provides a data structure that allows fast processing of queries (e.g., select or update) by indexing columns of tables over their values. Given a certain value for a column, the index should efficiently locate all records having that value"

index.py:

def init(self, table):

One index for each table. All our empty initially.

    self.indices = [None] *  table.num_columns

# returns the location of all records with the given value on column "column"
def locate(self, column, value):

# Returns the RIDs of all records with values in column "column" between "begin" and "end"
def locate_range(self, begin, end, column):

# Create index on specific column
def create_index(self, column_number):

# Drop index of specific column
def drop_index(self, column_number):