Remove unnecessary PQconsumeInput call from PQputCopyData; it's redundant
because pqSendSome will absorb input data anytime it'd be forced to block. Avoiding a kernel call per PQputCopyData call helps COPY speed materially. Alon Goldshuv
This commit is contained in:
parent
3a0a16cb7e
commit
9b012311f8
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.178 2006/01/11 08:43:13 neilc Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.179 2006/01/25 20:44:32 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1476,13 +1476,13 @@ PQputCopyData(PGconn *conn, const char *buffer, int nbytes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for NOTICE messages coming back from the server. Since the
|
* Process any NOTICE or NOTIFY messages that might be pending in the
|
||||||
* server might generate multiple notices during the COPY, we have to
|
* input buffer. Since the server might generate many notices during
|
||||||
* consume those in a reasonably prompt fashion to prevent the comm
|
* the COPY, we want to clean those out reasonably promptly to prevent
|
||||||
* buffers from filling up and possibly blocking the server.
|
* indefinite expansion of the input buffer. (Note: the actual read
|
||||||
|
* of input data into the input buffer happens down inside pqSendSome,
|
||||||
|
* but it's not authorized to get rid of the data again.)
|
||||||
*/
|
*/
|
||||||
if (!PQconsumeInput(conn))
|
|
||||||
return -1; /* I/O failure */
|
|
||||||
parseInput(conn);
|
parseInput(conn);
|
||||||
|
|
||||||
if (nbytes > 0)
|
if (nbytes > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user