I don't think it will matter since the DB connection will be open as long as $db is in scope (and I think its cached, so it might hang around till the script exits).