count(*) VS num_rows
View Single Post
04-02-2009, 09:27 PM
Join Date: Sep 2007
Originally Posted by
Hmmm very interesting, I thought that the flat file would have been faster just because it seems a bit more "raw" if you know what I mean. I'm not sure what code I would use but it would probably be fopen to open the file, and probably just a loop to count the lines.....
I wonder what the overhead is for that versus the DB....
Just a hypothetical question though, not that I am looking to replace my DB or anything....
If you are looking for a raw piece of text, it might be faster to search raw text, but it will without a doubt be more memory intensive because those functions tend to load it all into memory. If you are looking for anything more advanced than that, a database is probably your best bet.
You see, searching through raw text looks though every bit of it, SQL uses more advanced techniques so it doesn't have to do such a low level comparison.
The Following User Says Thank You to Village Idiot For This Useful Post:
View Public Profile
Send a private message to Village Idiot
Find More Posts by Village Idiot