FCLT#52877 -- 'YKPN Retail' geeft zeer slechte performance

svn path=/Website/branches/v2017.3/; revision=37615
This commit is contained in:
Jos Groot Lipman
2018-04-11 15:21:18 +00:00
parent a746e326e9
commit c946ad47ed

View File

@@ -580,6 +580,25 @@ function get_rel_obj_filter(stdm_key, level)
return rel_obj_filter;
}
// Door de alg_verdieping_key uit de ruimte op te leveren ipv. uit de verdieping is de performance veel beter?
var alg_v_onrgoed_boom_2 = "(SELECT a1.alg_regio_key,"
+ " a2.alg_district_key,"
+ " a3.alg_locatie_key,"
+ " a4.alg_gebouw_key,"
+ " a5.alg_verdieping_key,"
+ " a5.alg_ruimte_key"
+ " FROM alg_regio a0,"
+ " alg_district a1,"
+ " alg_locatie a2,"
+ " alg_gebouw a3,"
+ " alg_verdieping a4,"
+ " alg_ruimte a5"
+ " WHERE a0.alg_regio_key = a1.alg_regio_key"
+ " AND a1.alg_district_key = a2.alg_district_key"
+ " AND a3.alg_locatie_key = a2.alg_locatie_key"
+ " AND a3.alg_gebouw_key = a4.alg_gebouw_key"
+ " AND a4.alg_verdieping_key = a5.alg_verdieping_key)";
function get_res_bezorgfilter(params, level)
{
params = params || {};
@@ -623,7 +642,7 @@ function get_res_bezorgfilter(params, level)
+ " alg_verdieping_key,"
+ " alg_ruimte_key"
+ " FROM res_deel rd, ins_deel id, "
+ " alg_v_onrgoed_boom aob"
+ " " + alg_v_onrgoed_boom_2 + " aob"
+ " WHERE rd.res_ins_deel_key = id.ins_deel_key"
+ " AND COALESCE(id.ins_alg_ruimte_type_org, id.ins_alg_ruimte_type) = 'R'"
+ " AND COALESCE(id.ins_alg_ruimte_key_org, id.ins_alg_ruimte_key) = aob.alg_ruimte_key"
@@ -671,7 +690,7 @@ function get_res_bezorgfilter(params, level)
+ " FROM res_srtartikel_onrgoed"
+ ") obj"
+ " , res_activiteitdiscipline rad"
+ " , alg_v_onrgoed_boom aob"
+ " , " + alg_v_onrgoed_boom_2 + " aob"
+ " , alg_ruimte r"
+ " WHERE rad.res_discipline_key = obj.res_discipline_key"
+ " AND r.alg_ruimte_key = aob.alg_ruimte_key"
@@ -794,7 +813,7 @@ function get_loc_scope_act_filter(params, level)
+ " UNION "
+ "SELECT scope." + pSelect
+ " FROM res_v_aanwezigdeel r"
+ " , alg_v_onrgoed_boom scope"
+ " , " + alg_v_onrgoed_boom_2 + " scope"
+ " , res_v_deelscope ds"
+ " WHERE r.res_deel_key = ds.res_deel_key"
+ " AND (ds.alg_regio_key = scope.alg_regio_key"