improve lastlogin performance by using indexes, closes #1633, patch by lelutin

This commit is contained in:
Antoine Beaupr�� 2014-11-27 18:54:44 +00:00
parent 511653d327
commit 542c0f59b2
1 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,10 @@ if [ ! -r "$ALTERNC_CONFIG_FILE" ]; then
fi
. "$ALTERNC_CONFIG_FILE"
mysql_query "update address a, domaines d, mailbox m set m.lastlogin=now() where a.domain_id=d.id and m.address_id=a.id and concat_ws('@',a.address,d.domaine) = '$USER';"
addr=$(echo $USER | sed 's/@.*//')
dom=$(echo $USER | sed 's/^.*@//')
mysql_query "update address a, domaines d, mailbox m set m.lastlogin=now() where a.domain_id=d.id and m.address_id=a.id and a.address='$addr' and d.domaine='$dom';"
# Now launch the expected binary server
exec "$@"