Re: Little optimisation question

From: Date: Fri, 05 Jul 2002 12:10:08 +0000
Subject: Re: Little optimisation question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-105630@lists.php.net to get a copy of this message
Latex Master wrote:
I make connection to NNTP server and fetch headers from the news group lets say bla.bla.bla. Connection made ok. Next Php tryes to put everything into the array. It's okey if number of headers are lower then let's say 100. But if number of headers get greater then 100, it's a pain in the ass. I have to wait for 90-100 seconds till the operation completes. (I'm talking here about large value news groups). So I have faced that I need to optimize it somehow. At this point of time i've got only idea is to put all the headers in the database. But not sure how to update database frequently. Any ideas even fantastic ones are welcome.
привет! well, I never used an NNTP server, so I might say something stupid, but... What you do is get the headers in some chunks, right? One by one or something like that... so just make a table that has a timestamp column (plus the stuff you need to store the headers). Any time you execute a cycle like this: 1) compute a new timestamp 2) clear from the database table anything older then current timestamp 3) load the new headers directly (one read from NNTP -> one db insert) 4) use your table as a normal array Does that solve the problem? пока Альберто киев -- @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

« previous php.general (#105630) next »