Re: What's Better?

2003-08-03 Thread Rob Dixon

"Pablo Fischer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Hi
>
> I have 10 files, each file has 3000 lines. I have two options but I need to
> know which option is better in disk space and in cpu (the fastest one when I
> need th edata):
>
> 1. Keep the 10 files in one Zip, and When its time to use them, unzip them,
> and start parsing and processing each one.
>
> 2. Save each file in row of a table of my Database (using MySql, so I need to
> use DBI), and when Its time to use it, connect to the database, and retrieve
> row by row.

It depends.

On how you want to process the files' records when you have opened them.

- sequentially / at random
- frequently / infrequently
- read/write or read-only

and so on.

I would vote for option 1 unless you're doing it once a minute and need
read/write random access indexed by content, but even then there are
other ways. (3 .. 42) :)

How do you want to use this stuff Pablo?

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: What's Better?

2003-08-01 Thread Dan Muey
> Hi

Howdy!

> 
> I have 10 files, each file has 3000 lines. I have two options 
> but I need to 
> know which option is better in disk space and in cpu (the 
> fastest one when I 
> need th edata):
> 
> 1. Keep the 10 files in one Zip, and When its time to use 
> them, unzip them, 
> and start parsing and processing each one.
> 
> 2. Save each file in row of a table of my Database (using 
> MySql, so I need to 
> use DBI), and when Its time to use it, connect to the 
> database, and retrieve 
> row by row.

# 2 would seem to me to be a zillion times better. For instance if you want everythign 
just do:

SELECT ... FROM table

Done

But with # 1

Unzip files
Open files
Read files
Do somthign with each line
Close files

Now what if you want to grab specific data, say all of them with foo as the bar?

SELECT ... FROM table WHERE foo='bar'

Done

But with number one:

Unzip files
Open files
Read files
Look at eahc line 
Decide what to do witht the liine
Do that with the line
Close files

Flat files are ok for tiny tiny databases but for 3 records mysql will be tons 
easier to develop, easier to manage, and easier to use, faster (by a lot) etcc...

HTH

DMuey

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What's Better?

2003-08-01 Thread Janek Schleicher
Pablo Fischer wrote at Thu, 31 Jul 2003 18:52:20 +:

> I have 10 files, each file has 3000 lines. I have two options but I need to 
> know which option is better in disk space and in cpu (the fastest one when I 
> need th edata):
> 
> 1. Keep the 10 files in one Zip, and When its time to use them, unzip them, 
> and start parsing and processing each one.
> 
> 2. Save each file in row of a table of my Database (using MySql, so I need to 
> use DBI), and when Its time to use it, connect to the database, and retrieve 
> row by row.


And your Perl question is ... ?


Cheerio,
Janek

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What's Better?

2003-07-31 Thread Pablo Fischer
Hi

I have 10 files, each file has 3000 lines. I have two options but I need to 
know which option is better in disk space and in cpu (the fastest one when I 
need th edata):

1. Keep the 10 files in one Zip, and When its time to use them, unzip them, 
and start parsing and processing each one.

2. Save each file in row of a table of my Database (using MySql, so I need to 
use DBI), and when Its time to use it, connect to the database, and retrieve 
row by row.

Thanks!
Pablo
-- 
Pablo Fischer Sandoval ([EMAIL PROTECTED])
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131  AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]