Ottimizzazione query vista Segmenti

This commit is contained in:
Pek5892 2022-11-18 18:06:32 +01:00
parent 1d4635898e
commit 7262452c46
1 changed files with 20 additions and 1 deletions

View File

@ -316,4 +316,23 @@ FROM
WHERE
1 = 1
HAVING
2 = 2" WHERE `name` = 'Campi personalizzati';
2 = 2" WHERE `name` = 'Campi personalizzati';
-- Ottimizzazione query vista Segmenti
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`zz_segments`.`id`' WHERE `zz_modules`.`name` = 'Segmenti' AND `zz_views`.`name` = 'id';
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`zz_segments`.`NAME`' WHERE `zz_modules`.`name` = 'Segmenti' AND `zz_views`.`name` = 'Nome';
UPDATE `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` SET `zz_views`.`query` = '`zz_modules`.`NAME`' WHERE `zz_modules`.`name` = 'Segmenti' AND `zz_views`.`name` = 'Modulo';
UPDATE `zz_modules` SET `options` = "SELECT
|select|
FROM
`zz_segments`
LEFT JOIN `zz_modules` ON `zz_modules`.`id` = `zz_segments`.`id_module`
WHERE
1 = 1
HAVING
2 = 2
ORDER BY `zz_segments`.`NAME`,
`zz_segments`.`id_module`" WHERE `name` = 'Segmenti';