mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Enable parallelism for prepared statements and extended query protocol.
Parallel query can't handle running a query only partially rather than to completion. However, there seems to be no way to run a statement prepared via SQL PREPARE other than to completion, so we can enable it there without a problem. The situation is more complicated for the extend query protocol. libpq seems to provide no way to send an Execute message with a non-zero rowcount, but some other client might. If that happens, and a parallel plan was chosen, we'll execute the parallel plan without using any workers, which may be somewhat inefficient but should still work. Hopefully this won't be a problem; users can always set max_parallel_degree=0 to avoid choosing parallel plans in the first place. Amit Kapila, reviewed by me.
This commit is contained in:
parent
25924ac47a
commit
57a6a72b6b
@ -159,7 +159,7 @@ PrepareQuery(PrepareStmt *stmt, const char *queryString)
|
|||||||
nargs,
|
nargs,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0, /* default cursor options */
|
CURSOR_OPT_PARALLEL_OK, /* allow parallel mode */
|
||||||
true); /* fixed result */
|
true); /* fixed result */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1381,7 +1381,7 @@ exec_parse_message(const char *query_string, /* string to execute */
|
|||||||
numParams,
|
numParams,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0, /* default cursor options */
|
CURSOR_OPT_PARALLEL_OK, /* allow parallel mode */
|
||||||
true); /* fixed result */
|
true); /* fixed result */
|
||||||
|
|
||||||
/* If we got a cancel signal during analysis, quit */
|
/* If we got a cancel signal during analysis, quit */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user