Re: CSV speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You may want to consider an SQLite database.  Any PHP 5 install is likely to 
support it, and it should be very fast for reads.  (Not so much for writes, 
but if you're dealing with something that can use CSV, it will probably work 
in SQLite, too.)

On Monday 10 March 2008, TG wrote:
> If you can't store the values in a real DB, then that might be an option.
> You might consider using a temporary table if it's available in the
> database you're using, that way you don't have to worry about implicitly
> creating then destroying the table.
>
> The only problem is how temporary the temporary table may be.  If you can
> do everything you need in one connection, then you should be good. 
> Otherwise you'd want to use either a persistant connection or use a real
> table.
>
> You may also load all your CSV data into an array, but that may use up more
> memory and be slower and/or more cumbersome to search.
>
> You could try out a few scenarios and see how they work speed-wise and
> impact on system memory and such.
>
> -TG
>
> ----- Original Message -----
> From: Danny Brow <maillist@xxxxxxxxxxxxxxx>
> To: PHP <php-general@xxxxxxxxxxxxx>
> Date: Mon, 10 Mar 2008 21:09:15 -0400
> Subject:  CSV speed
>
> > I have about 10 csv files I need to open to access data. It takes a lot
> > of time to search each file for the values I need. Would it be best to
> > just dump all the cvs files to an SQL db and then just grab what I need
> > from there? I'm starting to think it would make a lot of sense. What do
> > you guys think?
> >
> > Thanks,
> > Dan


-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux