Re: [PHP] Whats faster? text files or mysql?

2004-04-22 Thread David T-G
Andrew --

...and then Andrew Fenn said...
% 
% I have two text files with two rows of data on each line sperated by a tab for about 
20 lines in each file. Would it be faster accessing this data by putting it in a mysql 
table?

For something so small I'd go with a text file unless you happen to
already really know and love your database server -- and it's not doing
much anyway.  The real time savings will come in your programming and
maintenance rather than in file access, so do whatever is easiest for
you.

My guess is that a straight file, even under something as bad as Windows
on an ATA disk, will be faster because of the overhead of talking to the
database; DBs shine when they have tons of data, not ounces.


HTH  HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] Whats faster? text files or mysql?

2004-04-21 Thread William Lovaton
Hi Jay,

El mar, 20-04-2004 a las 07:52, Jay Blanchard escribió:
 [snip]
 I have two text files with two rows of data on each line sperated by a
 tab for about 20 lines in each file. Would it be faster accessing this
 data by putting it in a mysql table?
 [/snip]
 
 Sounds like the perfect opportunity to set up a test! File I/O is always
 slower.

I/O is always slow, but it is even slower when it is done through a
network.  It is always faster accessing a file on the hard disk than
accessing it through the network.

If you don't need to index the information and make complex queries, a
text file on the web server hard disk is just fine.


-William

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Whats faster? text files or mysql?

2004-04-21 Thread William Lovaton
El mar, 20-04-2004 a las 08:24, John Nichel escribió:
 Jay Blanchard wrote:
  
  There is always awk! 
  
 
 Aw, no votes for cat | grep? ;)

No, that would be worse since the system needs to spawn a new process
and this is slow too.  Specially on a high loaded system.

If you are concerned about speed always use native functions.


-William

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Whats faster? text files or mysql?

2004-04-21 Thread John Nichel
William Lovaton wrote:
El mar, 20-04-2004 a las 08:24, John Nichel escribió:

Jay Blanchard wrote:

There is always awk! 

Aw, no votes for cat | grep? ;)


No, that would be worse since the system needs to spawn a new process
and this is slow too.  Specially on a high loaded system.
If you are concerned about speed always use native functions.

-William

It was a joke. :)

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread Jay Blanchard
[snip]
I have two text files with two rows of data on each line sperated by a
tab for about 20 lines in each file. Would it be faster accessing this
data by putting it in a mysql table?
[/snip]

Sounds like the perfect opportunity to set up a test! File I/O is always
slower.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread Travis Low
Isn't the database kept in a file?  Why would that file be faster than a plain 
text file?

cheers,

Travis

Jay Blanchard wrote:
[snip]
I have two text files with two rows of data on each line sperated by a
tab for about 20 lines in each file. Would it be faster accessing this
data by putting it in a mysql table?
[/snip]
Sounds like the perfect opportunity to set up a test! File I/O is always
slower.
--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread Jay Blanchard
[snip]
Isn't the database kept in a file?  Why would that file be faster than a
plain 
text file?
[/snip]

Of course it is, but the file is kept accessible by the database server
deamon so you are not reading from a file in the tradional sense.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread Mark Cubitt
I'm not sure but I think it would depend on the programming language and
with php File I/O is slower then database (mySql anyway).

Where as Perl would probably be quicker with the text file.

I could be wrong though

Regards

Mark Cubitt

 -Original Message-
 From: Travis Low [mailto:[EMAIL PROTECTED]
 Sent: 20 April 2004 14:12
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Whats faster? text files or mysql?


 Isn't the database kept in a file?  Why would that file be faster
 than a plain
 text file?

 cheers,

 Travis

 Jay Blanchard wrote:
  [snip]
  I have two text files with two rows of data on each line sperated by a
  tab for about 20 lines in each file. Would it be faster accessing this
  data by putting it in a mysql table?
  [/snip]
 
  Sounds like the perfect opportunity to set up a test! File I/O is always
  slower.
 

 --
 Travis Low
 mailto:[EMAIL PROTECTED]
 http://www.dawnstar.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread Jay Blanchard
[snip]
I'm not sure but I think it would depend on the programming language and
with php File I/O is slower then database (mySql anyway).

Where as Perl would probably be quicker with the text file.
[/snip]

There is always awk! 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread John W. Holmes
From: Andrew Fenn [EMAIL PROTECTED]

 I have two text files with two rows of data on each
 line sperated by a tab for about 20 lines in each file.
 Would it be faster accessing this data by putting it in a
 mysql table?

Depends what you want to do with the data. If you're searching through for
specific values, summing values, grouping, etc, then you'd probably be
better off putting it in a database as they are designed for those sort of
functions.

If you're just opening and displaying the file, or looking for one simple
match, then just leave it in a file.

Don't forget about SQLite if you choose the database route, also.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread John Nichel
Mark Cubitt wrote:
I'm not sure but I think it would depend on the programming language and
with php File I/O is slower then database (mySql anyway).
Where as Perl would probably be quicker with the text file.

I could be wrong though
It would really depend on the size of the file, and how the db table is 
set up.  No matter the size of the file, or if you're using php / Perl, 
you still have to open the file, and parse it line for line until you 
find the value you're looking for.  If the db table is indexed, it's 
going to be faster than most text files (unless you only have like 10 
records).

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Whats faster? text files or mysql?

2004-04-20 Thread John Nichel
Jay Blanchard wrote:
[snip]
I'm not sure but I think it would depend on the programming language and
with php File I/O is slower then database (mySql anyway).
Where as Perl would probably be quicker with the text file.
[/snip]
There is always awk! 

Aw, no votes for cat | grep? ;)

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php