Skip site navigation (1) Skip section navigation (2)

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

From: "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br>
To: <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <reina_ga(at)hotmail(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Anyone have example C code for Asynchronous Command Processing?
Date: 2004-03-08 15:59:27
Message-ID: 61481.200.174.148.100.1078761567.squirrel@webmail.webnow.com.br (view raw or flat)
Thread:
Lists: pgsql-novice
If the "INSERT INTO" calls are known previously, you can spawn several
connections at the same time.

It's argueable that it will finish sooner, but it may be worth trying.

> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org




In response to

pgsql-novice by date

Next:From: Martin HamplDate: 2004-03-08 21:17:43
Subject: psql + php on Mac OS X
Previous:From: Tom LaneDate: 2004-03-08 15:51:00
Subject: Re: Anyone have example C code for Asynchronous Command Processing?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group