Hi Don!
On Fri, 20 Jul 2001, Don Read wrote:

> 
> On 20-Jul-2001 Er Galv?o Abbott wrote:
> > Just a sugestion here, that may sound strange, but I'd do it like
> > this:
> > 
> > Why don't you keep a simle text-counter file for each user? Why this
> > HAVE to go trough SQL?
> > 
> > Just creat a text file with "0" on it. When the user posts, retrieve
> > the number from the file, increment it and then write it back...
> > 
> > This way you don't overload SQL and keep the post counter running...
> >
> 
> Because the database is optimized for this kind of stuff ?
> 
> Once you get the db handle (and you have. you've authenticated right ?),
>   "SELECT count(*) from msgposts where user_id=$foo" is likely be faster & less
> load then an open/read/close.
> 
> 
> Trying to avoid hitting the database is a good maxim, but it's not the goal.
> 
Note that a DB is ultimately doing the same thing, open and read a file, while
on the other hand you can have some fast support for sessions, like shared
memory which can be faster.

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to