>>>>> "Paul" == Paul DuBois <paul@stripped> writes:
Paul> At 10:02 AM +0300 7/17/99, Tõnu Samuel wrote:
>> Paul DuBois wrote:
>>> mysql_pconnect() can decrease the time needed to connect to the
>>> server, relative to mysql_connect() -- but how can mysql_pconnect()
>>> speed up an INSERT statement?
>> They can't directly. But there are three ways:
>> connect + 1 insert
>> connect + 2 inserts
>> connect + many inserts.
>> In case 1 pconnect will speed up everything by factor of two. If you
>> want speed, this it's not important where you get it. Most people who
>> asking about have case 1.
>> Second case is same
Paul> Okay, but don't you really mean that mysql_pconnect() speeds up
Paul> your server session, not that it speeds up inserts?
>> In third case it's a good idea to have everything encapsualted between
>> LOCK TABLES. Of course this depends.
Paul> Since we're talking about PHP functions, and therefore probably about
Paul> using MySQL in a Web context, is this a good idea? It locks out other
Paul> clients for the duration of your inserting.
One way to get more insert speed is to let the client pile up
insert statements and then do a multi-row insert to insert many rows
with one statement.