chris said:
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.
I replied:
Have you timed it?
Maybe I'll do that tomorrow.
On 4/3/06, tedd [EMAIL PROTECTED] wrote:
chris said:
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.
I replied:
Have
chris said:
Just out of interest, could you re-run the test using persistent connections?
change mysql_connect to mysql_pconnect..
In doing so, the overall results dropped from a tenth of a second
difference between both methods to three-one-hundredths of a second
difference. In other
On Mon, April 3, 2006 1:33 pm, tedd wrote:
Just out of interest, could you re-run the test using persistent
connections?
change mysql_connect to mysql_pconnect..
In doing so, the overall results dropped from a tenth of a second
difference between both methods to three-one-hundredths of a
tedd wrote:
chris said:
Just out of interest, could you re-run the test using persistent
connections?
change mysql_connect to mysql_pconnect..
[snip]
Thanks -- does the persistent connection thing hold the server up
until released? How does that work?
MySQL is threaded so will not be
I always close the connection right after my
query -- force of habit. It's like leaving the
toilet seat up, it's only going to get you into
trouble.
So you close it after every query and then re-open it later for the
next query? I don't see that as a good idea.
No, you
tedd wrote:
I always close the connection right after my
query -- force of habit. It's like leaving the
toilet seat up, it's only going to get you into
trouble.
So you close it after every query and then re-open it later for the
next query? I don't see that as a good idea.
On 4/2/06, tedd [EMAIL PROTECTED] wrote:
I always close the connection right after my
query -- force of habit. It's like leaving the
toilet seat up, it's only going to get you into
trouble.
So you close it after every query and then re-open it later for the
next
At 11:07 AM +1200 4/2/06, Jasper Bryant-Greene wrote:
tedd wrote:
I always close the connection right after my
query -- force of habit. It's like leaving the
toilet seat up, it's only going to get you into
trouble.
So you close it after every query and then re-open it later
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
On Sat, 2006-04-01 at 20:15, tedd wrote:
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
Robert Cummings wrote:
On Sat, 2006-04-01 at 20:15, tedd wrote:
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
On Sat, 2006-04-01 at 20:48, Jasper Bryant-Greene wrote:
Yeah, e.g. I have a database objects layer that means I only write SQL
in classes, everything else is just calling object methods. I create the
database object at the start of every script but that doesn't
necessarily open the
Robert Cummings wrote:
On Sat, 2006-04-01 at 20:48, Jasper Bryant-Greene wrote:
Yeah, e.g. I have a database objects layer that means I only write SQL
in classes, everything else is just calling object methods. I create the
database object at the start of every script but that doesn't
On Sat, 2006-04-01 at 21:39, Jasper Bryant-Greene wrote:
Robert Cummings wrote:
There's smart lazy programming, and sloppy lazy programming. I don't
trust anything magical in PHP. Most of us are familiar with the magic
quotes and global vars fiascos *LOL*. But hey, if you can squeeze a
Robert Cummings wrote:
On Sat, 2006-04-01 at 21:39, Jasper Bryant-Greene wrote:
Robert Cummings wrote:
There's smart lazy programming, and sloppy lazy programming. I don't
trust anything magical in PHP. Most of us are familiar with the magic
quotes and global vars fiascos *LOL*. But hey, if
On Sat, 2006-04-01 at 21:57, Jasper Bryant-Greene wrote:
Robert Cummings wrote:
Of course, it wouldn't exactly be a rewrite to make it close the
connection at the end of every script before PHP did, if I'm proven
wrong and it one day is necessary. I'd only need to change the database
Jasper Bryant-Greene wrote:
snip
I never close connections; PHP does that for me and has never caused any
problems doing that. I don't see it as sloppy programming, it is a
documented feature that PHP closes resources such as database
connections at the end of the script.
It's extremely
John Nichel wrote:
Jasper Bryant-Greene wrote:
snip
I never close connections; PHP does that for me and has never caused
any problems doing that. I don't see it as sloppy programming, it is a
documented feature that PHP closes resources such as database
connections at the end of the script.
On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote:
I was wondering why is it necessary to use mysql_close() at the
end
of your script.
If you don't do it, it works anyways, doesn't it?
Yes, but...
Suppose you write a script to read data from one MySQL server, and
then insert it into
Richard Lynch wrote:
On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote:
I was wondering why is it necessary to use mysql_close() at the
end
of your script.
If you don't do it, it works anyways, doesn't it?
Yes, but...
Suppose you write a script to read data from one MySQL
On 3/31/06, Martin Zvarík [EMAIL PROTECTED] wrote:
Richard Lynch wrote:
On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote:
I was wondering why is it necessary to use mysql_close() at the
end
of your script.
If you don't do it, it works anyways, doesn't it?
Yes, but...
At 10:30 PM +0200 3/31/06, Martin Zvarík wrote:
Hi,
I was wondering why is it necessary to use
mysql_close() at the end of your script.
If you don't do it, it works anyways, doesn't it?
MZ
MZ:
I always close the connection right after my
query -- force of habit. It's like leaving the
On 4/1/06, tedd [EMAIL PROTECTED] wrote:
At 10:30 PM +0200 3/31/06, Martin Zvarík wrote:
Hi,
I was wondering why is it necessary to use
mysql_close() at the end of your script.
If you don't do it, it works anyways, doesn't it?
MZ
MZ:
I always close the connection right after my
On 3/31/06, chris smith [EMAIL PROTECTED] wrote:
On 4/1/06, tedd [EMAIL PROTECTED] wrote:
At 10:30 PM +0200 3/31/06, Martin Zvarík wrote:
Hi,
I was wondering why is it necessary to use
mysql_close() at the end of your script.
If you don't do it, it works anyways, doesn't it?
MZ
On 4/1/06, Anthony Ettinger [EMAIL PROTECTED] wrote:
On 3/31/06, chris smith [EMAIL PROTECTED] wrote:
On 4/1/06, tedd [EMAIL PROTECTED] wrote:
At 10:30 PM +0200 3/31/06, Martin Zvarík wrote:
Hi,
I was wondering why is it necessary to use
mysql_close() at the end of your script.
26 matches
Mail list logo