![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
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. |
|
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. |
#2
| |||
| |||
|
|
"Matias Woloski" <woloski (AT) sion (DOT) com> wrote in message 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. If you say "academic", then forget about the "file". Main memory database even more theoretically legitimate then file based. |
#3
| |||
| |||
|
|
Do you have a free hand in what you can use to implement this ? Or does it have to be in C or C++ or some other given language ? |
|
Are you only having to use basic domains for attributes (integers,strings,etc.) ? |
|
My first instincts would be : - a functional programming language of your choice (mine would be Haskell) - Prolog - anything else a far distant third The reason being that it is very easy to define new structures and operations on them in these languages (for very different reasons). The stuff about disks, memory, etc. are as optimisations and/or side issues really - unless the task description says otherwise it sounds like the "interesting" bit of this is the representation of relations you choose and the definition of operators upon them. And that can be quite interesting ![]() |
#4
| |||
| |||
|
|
Are you only having to use basic domains for attributes (integers,strings,etc.) ? Yes, we should to provide CHAR(XXX), INT, LONG, FLOAT, DOUBLE, TIME, DATE. |
|
I think I will go for the file based approach. Creating temporary files for each query. What file organization schema do you recommend? Direct or Indexed? |
#5
| ||||
| ||||
|
|
We must do it in c or c++. Oh dear... |
|
Are you only having to use basic domains for attributes (integers,strings,etc.) ? Yes, we should to provide CHAR(XXX), INT, LONG, FLOAT, DOUBLE, TIME, DATE. I suppose my use of the word "basic" was incorrect; I should have said |
|
yes, that will be interesting... Indeedy. |
|
I think I will go for the file based approach. Creating temporary files for each query. What file organization schema do you recommend? Direct or Indexed? I'd have to say your lecturer, or whoever is setting the task, seems |
#6
| |||
| |||
|
|
Usenet groups are very shallow. You can't expect much help on such a huge topic here. The best thing to do is head to the bookstore for Garcia-Molina&Ulman&Widom Database Implementation textbook. |
#7
| |||
| |||
|
|
Matias Woloski wrote: Ok, sorry about that. I'll try to say something useful now. You might want to check out the chapter on Optimization in Chris Date's AN INTRODUCTION TO DATABASE SYSTEMS. I believe he gives an easy introduction there of possible implementations of the algebra operations. |
![]() |
| Thread Tools | |
| Display Modes | |
| |