Corrige la vue alis_view pour des problemes de perfs
This commit is contained in:
parent
265f3af83a
commit
1a9d69b702
|
@ -542,6 +542,7 @@ install/upgrades/3.0.3~a.sql -text
|
||||||
install/upgrades/3.0.3~b.sh -text
|
install/upgrades/3.0.3~b.sh -text
|
||||||
install/upgrades/3.1.0~a.sql -text
|
install/upgrades/3.1.0~a.sql -text
|
||||||
install/upgrades/3.1.0~b.php -text
|
install/upgrades/3.1.0~b.php -text
|
||||||
|
install/upgrades/3.2.1~a.sql -text
|
||||||
install/upgrades/README -text
|
install/upgrades/README -text
|
||||||
lang/.svnignore -text
|
lang/.svnignore -text
|
||||||
lang/README -text
|
lang/README -text
|
||||||
|
|
|
@ -643,22 +643,49 @@ where `address`.`enabled` = 1
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE OR REPLACE VIEW `alias_view` AS
|
CREATE OR REPLACE VIEW `alias_view` AS
|
||||||
select concat(`address`.`address`,'@',`domaines`.`domaine`) AS `mail`,
|
|
||||||
concat(if(isnull(`mailbox`.`id`),'',concat(concat(`address`.`address`,'@',`domaines`.`domaine`),'\n')),`recipient`.`recipients`) AS `alias`
|
-- Generate all the alias configured by the users
|
||||||
from (((`recipient` join `address` on((`address`.`id` = `recipient`.`address_id`)))
|
select
|
||||||
left join `mailbox` on((`mailbox`.`address_id` = `address`.`id`)))
|
concat(`address`.`address`,'@',`domaines`.`domaine`) AS `mail`,
|
||||||
join `domaines` on((`domaines`.`id` = `address`.`domain_id`)))
|
concat(if(isnull(`mailbox`.`id`),
|
||||||
where `address`.`enabled` = 1
|
'',
|
||||||
union
|
concat(concat(`address`.`address`,'@',`domaines`.`domaine`),'\n')),
|
||||||
select distinct concat(`m`.`login`,'@',`v`.`value`) AS `mail`,
|
`recipient`.`recipients`) AS `alias`
|
||||||
|
from
|
||||||
|
(
|
||||||
|
((`recipient` join `address` on((`address`.`id` = `recipient`.`address_id`)))
|
||||||
|
left join `mailbox` on((`mailbox`.`address_id` = `address`.`id`))
|
||||||
|
)
|
||||||
|
join `domaines` on((`domaines`.`id` = `address`.`domain_id`))
|
||||||
|
)
|
||||||
|
where
|
||||||
|
`address`.`enabled` = 1
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
-- Generate the alias for all the account
|
||||||
|
-- Example : account gaylord will have gaylord@FQDN
|
||||||
|
-- as an alias to his email account. FQDN can be
|
||||||
|
-- changed in variable mailname_bounce
|
||||||
|
select
|
||||||
|
distinct concat(`m`.`login`,'@',`v`.`value`) AS `mail`,
|
||||||
`m`.`mail` AS `alias`
|
`m`.`mail` AS `alias`
|
||||||
from ((`membres` `m` join `variable` `v`) join `domaines` `d`)
|
from
|
||||||
where (`v`.`name` = 'mailname_bounce')
|
((`membres` `m` join `variable` `v`) join `domaines` `d`)
|
||||||
union
|
where
|
||||||
select distinct concat('alterncpanel','@',`v`.`value`) AS `mail`,
|
`v`.`name` = 'mailname_bounce'
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
-- Generate an alias alterncpanel@FQDN to admin mail
|
||||||
|
select
|
||||||
|
distinct concat('alterncpanel','@',`v`.`value`) AS `mail`,
|
||||||
`m`.`mail` AS `alias`
|
`m`.`mail` AS `alias`
|
||||||
from ((`membres` `m` join `variable` `v`) join `domaines` `d`)
|
from
|
||||||
where (`v`.`name` = 'mailname_bounce' AND `m`.`uid`=2000);
|
((`membres` `m` join `variable` `v`) join `domaines` `d`)
|
||||||
|
where
|
||||||
|
(`v`.`name` = 'mailname_bounce' AND `m`.`uid`=2000);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Structure de la table `piwik_users`
|
-- Structure de la table `piwik_users`
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
CREATE OR REPLACE VIEW `alias_view` AS
|
||||||
|
|
||||||
|
-- Generate all the alias configured by the users
|
||||||
|
select
|
||||||
|
concat(`address`.`address`,'@',`domaines`.`domaine`) AS `mail`,
|
||||||
|
concat(if(isnull(`mailbox`.`id`),
|
||||||
|
'',
|
||||||
|
concat(concat(`address`.`address`,'@',`domaines`.`domaine`),'\n')),
|
||||||
|
`recipient`.`recipients`) AS `alias`
|
||||||
|
from
|
||||||
|
(
|
||||||
|
((`recipient` join `address` on((`address`.`id` = `recipient`.`address_id`)))
|
||||||
|
left join `mailbox` on((`mailbox`.`address_id` = `address`.`id`))
|
||||||
|
)
|
||||||
|
join `domaines` on((`domaines`.`id` = `address`.`domain_id`))
|
||||||
|
)
|
||||||
|
where
|
||||||
|
`address`.`enabled` = 1
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
-- Generate the alias for all the account
|
||||||
|
-- Example : account gaylord will have gaylord@FQDN
|
||||||
|
-- as an alias to his email account. FQDN can be
|
||||||
|
-- changed in variable mailname_bounce
|
||||||
|
select
|
||||||
|
distinct concat(`m`.`login`,'@',`v`.`value`) AS `mail`,
|
||||||
|
`m`.`mail` AS `alias`
|
||||||
|
from
|
||||||
|
((`membres` `m` join `variable` `v`) join `domaines` `d`)
|
||||||
|
where
|
||||||
|
`v`.`name` = 'mailname_bounce'
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
-- Generate an alias alterncpanel@FQDN to admin mail
|
||||||
|
select
|
||||||
|
distinct concat('alterncpanel','@',`v`.`value`) AS `mail`,
|
||||||
|
`m`.`mail` AS `alias`
|
||||||
|
from
|
||||||
|
((`membres` `m` join `variable` `v`) join `domaines` `d`)
|
||||||
|
where
|
||||||
|
(`v`.`name` = 'mailname_bounce' AND `m`.`uid`=2000);
|
||||||
|
|
Loading…
Reference in New Issue