Re: Anyone have example C code for Asynchronous Command Processing?
От | Tony and Bryn Reina |
---|---|
Тема | Re: Anyone have example C code for Asynchronous Command Processing? |
Дата | |
Msg-id | BAY8-DAV35XGeFaatao0001eb64@hotmail.com обсуждение исходный текст |
Ответ на | Anyone have example C code for Asynchronous Command Processing? (reina_ga@hotmail.com (Tony Reina)) |
Ответы |
Re: Anyone have example C code for Asynchronous Command Processing?
|
Список | pgsql-novice |
Yikes! I was hoping that by not having to wait for an acknowledgement that the data had been successfully dumped I could speed up the inserts. I guess I'll have to try to modify things to use COPY. Just for kicks... you said that you can't have multiple connections pendings over a single connection. Would there be any advantage for the same client to make multiple connections in this case? For example, if I had 2 INSERT queries ready to send, could I send them along 2 different connections (PQconn conn1, conn2) from the same C code? Would the 2 connections execute faster than running the 2 commands serial over the same connection? -Tony ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us> To: "Tony Reina" <reina_ga@hotmail.com> Cc: <pgsql-novice@postgresql.org> Sent: Monday, March 08, 2004 4:51 PM Subject: Re: [NOVICE] Anyone have example C code for Asynchronous Command Processing? > reina_ga@hotmail.com (Tony Reina) writes: > > I'm using libpq to dump some text files into a PostgreSQL database. > > It's just a bunch of "INSERT INTO" calls, but they block one another > > waiting for the INSERT command to return. I think I can speed things > > up by using asynchronous command processing (e.g. PQsendQuery, > > PQgetResult). > > No you can't, because you can't have multiple commands pending over a > single connection. > > You would get significantly more speedup by using COPY, anyway. > > regards, tom lane >
В списке pgsql-novice по дате отправления: