Git Product home page Git Product logo

useless_isam's Introduction

Useless ISAM

This is a simple pet-project about a easy-understable minimal ISAM database.

It is composed by three separate executables.

If you are curious how is made I wrote a tutorial about it. Check it on GitHub Pages: https://johnhop.github.io/useless_isam/

csv2bin

Convert the dataset file from a .csv format a to binary file according to PAGE_SIZE value in params.h.

index-gen

Generate an index (binary) file from the binary file generated by the csv2bin executable. Furthermore, records are ordered by id to improve performance during retrieval of records.

isam

This is the database. Just use the index generated by index-gen and the binary file generated by csv2bin in order to read records selected by the user.

Usage

Parameters are hard-coded in params.h. They are

  • PAGE_SIZE (= 4096)
  • DATASET_FILENAME, location of the .csv dataset file
  • DATABASE_FILENAME
  • INDEX_FILENAME

Their values are set assuming that you will clone this repo and use cmake to build the executables.

First, execute csv2bin in order to obtain a binary file database.bin

$ > ./csv2bin

After, execute index-gen on database.bin in order to obtain the index.bin file

$ > ./index-gen

Finally, you can execute isam to querying the database.
Supported queries are single and range selection:

isam > SELECT [id]

or

isam > SELECT [start_id] - [end_id]

Examples

isam > SELECT 40047
40047, Gomishan, Iran. Islamic Rep. of

or

isam > SELECT 40000 - 50000
40047, Gomishan, Iran. Islamic Rep. of
41151, Pa'in-e Bazar-e Rudbar, Iran. Islamic Rep. of
41210, Khorramdarreh, Iran. Islamic Rep. of
41428, Padegan-e Manjil, Iran. Islamic Rep. of
44439, Kavar, Iran. Islamic Rep. of
49593, Yeed, Somalia
49747, Xuddur, Somalia

useless_isam's People

Contributors

johnhop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.