On 20-Jul-2001 [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 [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]