|
From: Javier H. <jhe...@ce...> - 2013-10-09 11:20:31
|
Hello,
I am not sure if this is the right mailing list for sending Feature
request, if not, sorry for the inconvenience.
I know you are working on improvements to the planner (Feature
Request #95). One important for my project is the ability to use FQS for
queries that reference elements in an array column. One example:
CREATE TABLE TestArray (id SERIAL, flux FLOAT4*[]*, error FLOAT*[]*);
SELECT flux, error FROM TestArray WHERE id = 12; -- Planner uses FQS
SELECT flux[1], error[1] FROM TestArray WHERE id = 12; -- Planner
uses Remote query and completes in coordinator
I am beginning to dig in the code and I think I have a temporary
solution:
src/backend/optimizer/util/pgxcship.c:709
case T_ArrayRef:
/*
* When multiple values of of an array are updated at once
* FQS planner cannot yet handle SQL representation correctly.
* So disable FQS in this case and let standard planner
manage it.
*/
if (sc_context->sc_query != NULL &&
sc_context->sc_query->commandType == CMD_SELECT) {
pgxc_set_exprtype_shippability(exprType(node),
sc_context);
} else {
pgxc_set_shippability_reason(sc_context,
SS_UNSUPPORTED_EXPR);
pgxc_set_exprtype_shippability(exprType(node),
sc_context);
}
break;
The original code is always marking the query as
SS_UNSUPPORTED_EXPR, but according to the existing comment I think my
change is safe for Select. Isn't it?
Thank you very much,
--
Javier Hernández
Ingeniero de Bases de Datos
Centro de Estudios de Fisica del Cosmos de Aragon (ceFca)
http://www.cefca.es
Plza San Juan Nº 1, Planta 2ª
E-44001 Teruel (Spain)
Phone: +34 978 221266 Ext.1105
Fax: +34 978 611801
|