Re: Re: (another, not entirely)sessions question
| From: | Don Read | Date: | Fri, 20 Jul 2001 20:07:25 +0000 |
| Subject: | Re: Re: (another, not entirely)sessions question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-58967@lists.php.net to get a copy of this message | ||
On 20-Jul-2001 teo@gecadsoftware.com 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@texas.net
-- 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.