mirror of https://github.com/citusdata/citus.git
Merge 2b520fdc4a
into 4cd8bb1b67
commit
9fb1b45b98
|
@ -815,8 +815,11 @@ AdaptiveExecutor(CitusScanState *scanState)
|
||||||
* be part of the same transaction.
|
* be part of the same transaction.
|
||||||
*/
|
*/
|
||||||
UseCoordinatedTransaction();
|
UseCoordinatedTransaction();
|
||||||
|
|
||||||
|
ParamListInfo boundParams = copyParamList(paramListInfo);
|
||||||
|
|
||||||
taskList = ExplainAnalyzeTaskList(taskList, defaultTupleDest, tupleDescriptor,
|
taskList = ExplainAnalyzeTaskList(taskList, defaultTupleDest, tupleDescriptor,
|
||||||
paramListInfo);
|
boundParams);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Multiple queries per task is not supported with local execution. See the Assert in
|
* Multiple queries per task is not supported with local execution. See the Assert in
|
||||||
|
|
|
@ -919,7 +919,11 @@ FetchRemoteExplainFromWorkers(Task *task, ExplainState *es, ParamListInfo params
|
||||||
|
|
||||||
if (params)
|
if (params)
|
||||||
{
|
{
|
||||||
ExtractParametersFromParamList(params, ¶mTypes, ¶mValues, false);
|
/* force evaluation of bound params */
|
||||||
|
params = copyParamList(params);
|
||||||
|
|
||||||
|
ExtractParametersForRemoteExecution(params, ¶mTypes,
|
||||||
|
¶mValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sendStatus = SendRemoteCommandParams(connection, explainQuery->data,
|
int sendStatus = SendRemoteCommandParams(connection, explainQuery->data,
|
||||||
|
@ -1890,6 +1894,7 @@ FetchPlanQueryForExplainAnalyze(const char *queryString, ParamListInfo params)
|
||||||
ParameterResolutionSubquery(params));
|
ParameterResolutionSubquery(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
appendStringInfoString(fetchQuery,
|
appendStringInfoString(fetchQuery,
|
||||||
"SELECT explain_analyze_output, execution_duration "
|
"SELECT explain_analyze_output, execution_duration "
|
||||||
"FROM worker_last_saved_explain_analyze()");
|
"FROM worker_last_saved_explain_analyze()");
|
||||||
|
@ -1913,6 +1918,12 @@ ParameterResolutionSubquery(ParamListInfo params)
|
||||||
for (int paramIndex = 0; paramIndex < params->numParams; paramIndex++)
|
for (int paramIndex = 0; paramIndex < params->numParams; paramIndex++)
|
||||||
{
|
{
|
||||||
ParamExternData *param = ¶ms->params[paramIndex];
|
ParamExternData *param = ¶ms->params[paramIndex];
|
||||||
|
|
||||||
|
if (param->ptype == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
char *typeName = format_type_extended(param->ptype, -1,
|
char *typeName = format_type_extended(param->ptype, -1,
|
||||||
FORMAT_TYPE_FORCE_QUALIFY);
|
FORMAT_TYPE_FORCE_QUALIFY);
|
||||||
|
|
||||||
|
|
|
@ -3239,6 +3239,19 @@ SET auto_explain.log_min_duration = 0;
|
||||||
set auto_explain.log_analyze to true;
|
set auto_explain.log_analyze to true;
|
||||||
-- the following should not be locally executed since explain analyze is on
|
-- the following should not be locally executed since explain analyze is on
|
||||||
select * from test_ref_table;
|
select * from test_ref_table;
|
||||||
|
CREATE TABLE test_auto_explain.test_params
|
||||||
|
( coll1 int8 NULL,
|
||||||
|
coll2 int4 NOT NULL);
|
||||||
|
SELECT create_distributed_table('test_auto_explain.test_params', 'coll1');
|
||||||
|
|
||||||
|
CREATE OR REPLACE PROCEDURE test_auto_explain.test_delete_from(p_coll2 int)
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
DELETE FROM test_auto_explain.test_params
|
||||||
|
WHERE coll2 = p_coll2;
|
||||||
|
END;$$;
|
||||||
|
CALL test_auto_explain.test_delete_from(20240401);
|
||||||
DROP SCHEMA test_auto_explain CASCADE;
|
DROP SCHEMA test_auto_explain CASCADE;
|
||||||
SET client_min_messages TO ERROR;
|
SET client_min_messages TO ERROR;
|
||||||
DROP SCHEMA multi_explain CASCADE;
|
DROP SCHEMA multi_explain CASCADE;
|
||||||
|
|
|
@ -3228,6 +3228,19 @@ SET auto_explain.log_min_duration = 0;
|
||||||
set auto_explain.log_analyze to true;
|
set auto_explain.log_analyze to true;
|
||||||
-- the following should not be locally executed since explain analyze is on
|
-- the following should not be locally executed since explain analyze is on
|
||||||
select * from test_ref_table;
|
select * from test_ref_table;
|
||||||
|
CREATE TABLE test_auto_explain.test_params
|
||||||
|
( coll1 int8 NULL,
|
||||||
|
coll2 int4 NOT NULL);
|
||||||
|
SELECT create_distributed_table('test_auto_explain.test_params', 'coll1');
|
||||||
|
|
||||||
|
CREATE OR REPLACE PROCEDURE test_auto_explain.test_delete_from(p_coll2 int)
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
DELETE FROM test_auto_explain.test_params
|
||||||
|
WHERE coll2 = p_coll2;
|
||||||
|
END;$$;
|
||||||
|
CALL test_auto_explain.test_delete_from(20240401);
|
||||||
DROP SCHEMA test_auto_explain CASCADE;
|
DROP SCHEMA test_auto_explain CASCADE;
|
||||||
SET client_min_messages TO ERROR;
|
SET client_min_messages TO ERROR;
|
||||||
DROP SCHEMA multi_explain CASCADE;
|
DROP SCHEMA multi_explain CASCADE;
|
||||||
|
|
|
@ -1180,6 +1180,22 @@ set auto_explain.log_analyze to true;
|
||||||
-- the following should not be locally executed since explain analyze is on
|
-- the following should not be locally executed since explain analyze is on
|
||||||
select * from test_ref_table;
|
select * from test_ref_table;
|
||||||
|
|
||||||
|
CREATE TABLE test_auto_explain.test_params
|
||||||
|
( coll1 int8 NULL,
|
||||||
|
coll2 int4 NOT NULL);
|
||||||
|
|
||||||
|
SELECT create_distributed_table('test_auto_explain.test_params', 'coll1');
|
||||||
|
|
||||||
|
CREATE OR REPLACE PROCEDURE test_auto_explain.test_delete_from(p_coll2 int)
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
DELETE FROM test_auto_explain.test_params
|
||||||
|
WHERE coll2 = p_coll2;
|
||||||
|
END;$$;
|
||||||
|
|
||||||
|
CALL test_auto_explain.test_delete_from(20240401);
|
||||||
|
|
||||||
DROP SCHEMA test_auto_explain CASCADE;
|
DROP SCHEMA test_auto_explain CASCADE;
|
||||||
|
|
||||||
SET client_min_messages TO ERROR;
|
SET client_min_messages TO ERROR;
|
||||||
|
|
Loading…
Reference in New Issue