mini database - educational project

From: Matias Woloski <woloski_at_sion.com>
Date: Wed, 27 Aug 2003 17:37:37 -0300
Message-ID: <bij50r$a5u8n$1_at_ID-148083.news.uni-berlin.de>



Hi,
I need to implement/develop a small database for unix which should support most of the relational algebra operators, such as Projection, Selection, Product, Union, etc.

This is a one month project, so it needs to be easy to implement.

Right now, I'm designing the data structures and thinking about how I will handle the tables logically and phisically.

Here is an example of the query language it will support

// this will open a table from myTable file
MyTable = TABLE "/root/myTable"

// this will create a new table only with the NAME and AGE column
NamesAndAge = PROJ MyTable( NAME, AGE )

// this will create a new table with people who are older than 50
Older = SEL NamesAndAge ( AGE > 50 )

This is a small example of what it will have to do.

I'm asking myself how should I implement this. These are the options I thought:

  1. Bring the physical data to an in memory structure when executing the TABLE command. Then creates inmemory tables for each command executed. So I will end up with 3 tables in memory for the example above.
  2. Work with the file directly. Maybe with Direct Access files. So when doing PROJ for instance, I would go through myTable file and grab the columns needed and save it in another temporal file.

The first will be faster and easier to implement but it has the downside of depend on the RAM of the system. The second will work on every scenario but will be much slower than the first considering it will work with files.

What do you think it will work best? Considering it should be done in a month and it is something with academic purpose.

thanks,
Matias Received on Wed Aug 27 2003 - 22:37:37 CEST

Original text of this message