php-general | 2001072

Re: [PHP] Re: (another, not entirely)sessions question From: Don Read (dread <email protected>)
Date: 07/20/01

On 20-Jul-2001 teo <email protected> wrote:
> Hi Don!
> On Fri, 20 Jul 2001, Don Read wrote:
>

<snip>

>> 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.
>

In a query like the above; the server probably already has the index cached, so
it would only be a memory hit not a physical disk access.

Regards,

-- 
Don Read                                       dread <email protected>
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 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>