VMware Tanzu Greenplum

 View Only

 The union of all when you change the order of queries stops working

ced ced's profile image
ced ced posted Mar 05, 2020 01:38 PM

Query 1, the execution time of 6 seconds:

 SELECT

'FVF' type,

id_post,

vehicle_type,

dt,

prognoz

FROM r_for_report_prognoz_fvf

where prognoz > 0

union all

SELECT

'APVGK' type,

id_post,

vehicle_type,

dt,

prognoz FROM r_for_report_prognoz_apvgk

where prognoz > 0;

 

Query 2, can not wait to perform:

SELECT

'APVGK' type,

id_post,

vehicle_type,

dt,

prognoz

FROM r_for_report_prognoz_apvgk

where prognoz > 0

union all

SELECT

'FVF' type,

id_post,

vehicle_type,

dt,

prognoz FROM r_for_report_prognoz_fvf

where prognoz > 0;

 

Attachment  View in library