Time. Opening a db connection is time consuming. There are many levels
involved (making the connection, authentication, etc).. Even worse if
the connection is over tcp/ip because that overhead comes in on top as
well.

Have you timed it?

It would be interesting to actually run a script that opens, retrieves, and inserts data -- let's say 50k times. What's the time difference between one open, 50k retrieves/inserts, and one close-- as compared 50k opens retrieve/insert closes?

Maybe I'll do that tomorrow.

 > You see, my habit stems from doing a lot of communication programming
 -- it was my experience that you open a communication port
 (file/channel/port/whatever); establish a link; exchange data; and
 close it. There's no need to leave it open.

Just because you can close it doesn't mean you have to.

Everyone has their own way.

tedd
--
--------------------------------------------------------------------------------
http://sperling.com

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

Reply via email to