Posted by Jerry Stuckle on 03/23/06 07:10
PD wrote:
> Thanks for the input Bogdan.
>
> I use MySQL 4 so subselect is out.
>
> Also I had a confusion. I dont understand how a persistant connection
> can help boost the speed. I thought it the other way. So I open and
> close a connection at every query. A persistant connection can run the
> db into a lot of open connections, wont it? Please throw some light on
> this one.
>
> Thanks again!
>
Yes and no. Persistent connections will stay open - but your script will run
very quickly compared to real-time. You probably won't have very many
connections in use at one time. OTOH, there is a significant amount of overhead
in connecting to MySQL.
Personally, I do it a little differently. I make the connection at the
beginning of the script (or no later than first use). Then I close the
connection before the script exits.
In most cases it works as fast as persistent connection (which have their own
overhead associated with them) but doesn't make multiple connections per script
to the database.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|