UWVA#53544 Voorkom slechte performance voor CRO033 res_list door indexen te beinvloeden

svn path=/Website/branches/v2017.3/; revision=38174
This commit is contained in:
Jos Groot Lipman
2018-06-12 07:59:18 +00:00
parent 6a66847962
commit b438f67be2

View File

@@ -800,7 +800,10 @@ function res_list (pautfunction, params)
}
}
var sqlinside = "WITH " + thePerslid + "," + theResrsv + " " + sqlR + " \nUNION ALL\n " + sqlDe + " \nUNION ALL\n " + sqlA;
var sqlinside = "WITH " + thePerslid + "," + theResrsv
+ " /* Ruimtes */ " + sqlR
+ " \nUNION ALL\n /* Voorzieningen */ " + sqlDe
+ " \nUNION ALL\n /* Artikelen */ " + sqlA;
// Indien verschillende dirtlevels bij dirty reservering, neem dan het maximum om dubbele regels te voorkomen
// Geld hier alleen voor fronto en frontend
var sql_rec2 = " SELECT res_reservering_key"
@@ -1560,7 +1563,7 @@ function res_list (pautfunction, params)
"res_geg.res_ins_discipline_key",
"di.alg_regio_key",
"l.alg_district_key",
"ruimte_geg.alg_locatie_key",
"(ruimte_geg.alg_locatie_key+0)", // Voorkom slechte performance voor CRO033
"ruimte_geg.alg_gebouw_key",
"ruimte_geg.alg_verdieping_key",
"ruimte_geg.alg_ruimte_key",
@@ -1579,7 +1582,7 @@ function res_list (pautfunction, params)
"res_geg.res_ins_discipline_key",
"di.alg_regio_key",
"l.alg_district_key",
"ruimte_geg.alg_locatie_key",
"(ruimte_geg.alg_locatie_key+0)", // Voorkom slechte performance voor CRO033
"ruimte_geg.alg_gebouw_key",
"ruimte_geg.alg_verdieping_key",
"ruimte_geg.alg_ruimte_key",
@@ -1598,7 +1601,7 @@ function res_list (pautfunction, params)
"res_geg.res_ins_discipline_key",
"di.alg_regio_key",
"l.alg_district_key",
"ruimte_geg.alg_locatie_key",
"(ruimte_geg.alg_locatie_key+0)", // Voorkom slechte performance voor CRO033
"ruimte_geg.alg_gebouw_key",
"ruimte_geg.alg_verdieping_key",
"ruimte_geg.alg_ruimte_key",
@@ -1611,20 +1614,20 @@ function res_list (pautfunction, params)
var sql_from_total = "";
if (res_key || roomcat)
{
sql_from_total += sql_from_room_part;
sql_from_total += "/* Ruimtes */ " + sql_from_room_part;
if (res_key || objcat || artcat)
sql_from_total += " \nUNION ALL\n "
}
if (res_key || objcat)
{
sql_from_total += sql_from_obj_part;
sql_from_total += "/* Objecten */ " + sql_from_obj_part;
if (res_key || artcat)
sql_from_total += " \nUNION ALL\n "
}
if (res_key || artcat)
sql_from_total += sql_from_art_part;
sql_from_total += "/* Artikelen */ " + sql_from_art_part;
sql = "WITH " + thePerslid + "," + theResrsv + sql_from_total;