[ai_group] Re: Database format

  • From: John Jacques <johnj_01201@xxxxxxxxx>
  • To: ai_group@xxxxxxxxxxxxx
  • Date: Thu, 18 Apr 2002 16:25:36 -0700 (PDT)

Hello, here's my thoughts on the database:

1) A database can be one table or many tables. You can also have many
databases. I just wanted to say this because some people confuse a
table with a database. If you have a flat-file database the table is
the database. I'm sure if you are looking for size and speed efficency
you will want to go with a relational database with indexes and keys.

2) A comma delimted format is easy to interface with and allows for a
100% compatibility with almost every database program in existence. If
you want to convert the data to another database format or look at your
data in another application it is all compatible.

3) If you use 1 large file and have 1 field on each line it will be
easy to access the data, but you will end up wasting an enormous amount
of space and speed. You will also have to have some type of validation
to make sure the line you are reading is actually the field of data you
think is located on that line.

4) Once we figure out the table names we can add field names to each
table to decided on what data will be stored in each table. The tables
would be relationed to other tables so speed in accessing the desired
information, searching, and non-duplication of data will then be
possible.

5) After we have the database or database(s) planned out we would
decided on which field(s) would be most important and load those fields
into memmory for super fast access and searching.

Lets say for example something simple:

Database Name: AI Bot#1

Table #1: Objects
Table #2: Parts
Table #3: Properties

Each table is just a list of data all indexed with a unique number.

Example of Objects:
1,"Car"
2,"Boat"
3,"dog"

Example of parts:
1, "Wheel"
2, "Light Bulb"
3, "Wax"

Then another table could link the data in these 2 tables:

ObjectParts:
FieldNames:OPID,ObjectID,PartID
1,1,1
2,1,2
3,1,3

I know it can get really confusing, but you can start of simpler will
just plain tables of comma delimited data and then in the future when
you need more speed or recover space you can add relationships,
indexes, etc..

This approach allows selected fields to be stored in regular arrays.
the indexes allow the data to be search and retrieved very quickly by
pulling records that match the ID of the relationships.

You could also have an entire table (say the Objects) table loaded into
memmory because it is smaller and the Parts/Properties are stored in
another file.

I guess what I am saying is the most important thing is to really put
alot into designing your database. Select the field names and decided
if  you want to throw some of the data into another table.

I've started designing mine and it consist of 3 databases and about 20
tables. It is designed to start of with a few tables and at any time
more can be added without any modification to the other data. Maybe
someone could open a yahoo group just for file sharing?

Ohy, and with the comma delimted format you could load an entire
record, a few, or an entire table into memmory if you have room for it.
Again with a relation setup each table will be smaller and there will
be a very low duplication of data stored overall.

John



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

Other related posts: