php-general | 2001072
Date: 07/20/01
- Next message: Inércia Sensorial: "Re: [PHP] Unlink Woes"
- Previous message: Seb Frost: "[PHP] Displaying tables"
- In reply to: Don Read: "RE: [PHP] Re: (another, not entirely)sessions question"
- Next in thread: Don Read: "Re: [PHP] Re: (another, not entirely)sessions question"
- Reply: Don Read: "Re: [PHP] Re: (another, not entirely)sessions question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Inércia Sensorial: "Re: [PHP] Unlink Woes"
- Previous message: Seb Frost: "[PHP] Displaying tables"
- In reply to: Don Read: "RE: [PHP] Re: (another, not entirely)sessions question"
- Next in thread: Don Read: "Re: [PHP] Re: (another, not entirely)sessions question"
- Reply: Don Read: "Re: [PHP] Re: (another, not entirely)sessions question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

