Re: Limiting connection to mysql using old mysql module (not mysqli)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Per Jessen wrote:
Stut wrote:

Indeed, but only if you're making a lot of repetitive queries to the
database.

Which is typically what a busy website does :-)

The query cache only works if you give it exactly the same query.

That is:

select blah from table where id=1;

if it changes to

select blah from table where id=2;

then it's not fetched from the cache and thus hits the real data (this then gets cached in case it's called again next time).

or even

select blah, blah2 from table where id=1;

will not hit the first cache because the fields are different.

http://dev.mysql.com/doc/refman/4.1/en/query-cache-how.html

However, since the OP wants to reduce the number of connections to the database, query caching may reduce the time each
connection is held for it will not reduce the overall number of
connections.

The number of connections is presumably only important if we speak about
the number of concurrent connections.  If each query can be dealt with
faster due to caching, the number of concurrent connections should
drop.

Err no - it still has to connect to the database (thus use a connection slot) to even get to the cache.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux