> I have to store a whole lot of text files into a database, each one
> containing 3 columns containing numbers and about 2500 lines. I was
> wondering if anyone knew which would be the best way to store these files,
> having one big table with each row containing the contents of the files,
or
> making one table for each file and inserting each line of the file into
its
> respective row in the database. The database will probably become pretty
> big and I'm looking for the option that won't slow it down too much.

Will you need to search/sort on individual columns?
In what ways will you need to get the data out?
Does the file a row came from have any significance?  Will it need to "go
back" into that file if it changes?
Are these numbers integers, or floating point?  How big/small do the numbers
get?

Best Guess:
The three columns are significant, and you'll need to sort/search on them
individually.
In that case, there's really no question:  One table, three columns, each
column indexed individually.

Define "pretty big"...  How many rows do you expect: 10K, 100K, 1M, 10M,
100M, ...?
Anything up to 1 million isn't really considered "big" for MySQL or
PostgreSQL :-)
Epecially if the numbers are within ranges that make built-in data-types
"int" or "float" acceptable. :-)

Is adding text files an ongoing process that needs to happen quickly, or a
one-time load-up, and then the database stays fairly static?
If this is a one-time load-up, you needn't worry as much about the speed of
your import routine.
You still might want to whip up something to keep track of which files have
been "done" and automate the process so you just turn it on and go away for
a day or two. :-)

What's more important to you:  SPEED or HARD DRIVE space?
You could not do the indices on the columns if you're really short on hard
drive space, and search/sort speed is not important...  This seems pretty
unlikely, or you wouldn't be putting these in a database in the first place.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to