dbTalk Databases Forums  

Re: mini database - educational project

comp.databases.theory comp.databases.theory


Discuss Re: mini database - educational project in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mikito Harakiri
 
Posts: n/a

Default Re: mini database - educational project - 08-27-2003 , 03:56 PM







"Matias Woloski" <woloski (AT) sion (DOT) com> wrote

Quote:
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.
<snip>

Quote:
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.
If you say "academic", then forget about the "file". Main memory database
even more theoretically legitimate then file based.




Reply With Quote
  #2  
Old   
Matias Woloski
 
Posts: n/a

Default Re: mini database - educational project - 08-27-2003 , 04:31 PM







"Mikito Harakiri" <mikharakiri (AT) ywho (DOT) com> escribió en el mensaje
news:Z193b.29$84.180 (AT) news (DOT) oracle.com...
Quote:
"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.
I don't think I understand. You are saying that I should stay out of a file
based approach? why? can you give me more arguments?
I'm really thinking about doing it file based because of the memory
restriction. Apart from that the profesor warn us about that: "You could
have a 2gb table stored in the file system, so you won't be able to load the
whole in memory"

Now you would say "so you have no option". That's not completly true,
because when they evaluate the solution, they do some tests and you have to
pass more than 60% of the tests. So maybe one or two tests are big files,
but the other tests other functionality. I hope you understand ...

thanks for the help




Reply With Quote
  #3  
Old   
Matias Woloski
 
Posts: n/a

Default Re: mini database - educational project - 08-28-2003 , 01:14 PM




"Tony Douglas" <tonyisyourpal (AT) netscape (DOT) net> escribió en el mensaje

Quote:
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 ?
We must do it in c or c++.

Quote:
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.

Quote:
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
yes, that will be interesting...
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?

thanks,
Matias




Reply With Quote
  #4  
Old   
Mikito Harakiri
 
Posts: n/a

Default Re: mini database - educational project - 08-28-2003 , 02:41 PM



"Matias Woloski" <woloski (AT) sion (DOT) com> wrote

Quote:
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.
You probably gave up on my "input", but let me still comment.

Why are you persistently looking for extra work in educational project? In
particular, why do have to distinguish between say FLOAT and DOUBLE?

Quote:
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?
Did you ever take database implementation class?




Reply With Quote
  #5  
Old   
Tony Douglas
 
Posts: n/a

Default Re: mini database - educational project - 08-29-2003 , 07:55 AM



"Matias Woloski" <woloski (AT) sion (DOT) com> wrote

Quote:
We must do it in c or c++.

Oh dear...

Quote:
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
"predefined only". In either case, it makes things easier.

Quote:
yes, that will be interesting...

Indeedy.

Quote:
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
hell-bent on giving you a hard time ! The "interesting" bit is really
the relational operators, and how they work. But it seems like you
might have to get interested in a whole pile of side issues (like,
"how do I get things on and off disk quickly ?") To make this
achievable, I think you'll have to find some "canned libraries" for
the basic file access parts, simply so you can focus on the useful
bits of the project, and for that I'm afraid I can't offer any useful
input. Sorry I couldn't be of more assistance on this.

- Tony


Reply With Quote
  #6  
Old   
Alfredo Novoa
 
Posts: n/a

Default Re: mini database - educational project - 08-30-2003 , 02:40 PM



"Mikito Harakiri" <mikharakiri (AT) ywho (DOT) com> wrote


Quote:
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.
A google search on "value instance connectivity" (quotes included)
could be interesting either.

BTW I miss integrity constraint coverage in Garcia-Molina et all
textbook.

Regards
Alfredo


Reply With Quote
  #7  
Old   
Alfredo Novoa
 
Posts: n/a

Default Re: mini database - educational project - 08-30-2003 , 02:43 PM



Jan Hidders <jan.hidders (AT) pandora (DOT) be> wrote

Quote:
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.
And also the TransRelational Model appendix of the 8th edition.


Regards
Alfredo


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.