Re: Anyone have example C code for Asynchronous Command Processing?

From: "Tony and Bryn Reina" <reina_ga(at)hotmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Anyone have example C code for Asynchronous Command Processing?
Date: 2004-03-09 11:13:06
Message-ID: BAY8-DAV35XGeFaatao0001eb64@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tony Reina" <reina_ga(at)hotmail(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Sent: Monday, March 08, 2004 4:51 PM
Subject: Re: [NOVICE] Anyone have example C code for Asynchronous Command
Processing?

> reina_ga(at)hotmail(dot)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
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message daq 2004-03-09 12:14:24 Re: Getting Column Information from a Table with psql
Previous Message stm23 2004-03-09 06:14:15 JDBC driver & local server