optimisation de la requete pour les notifications du carnet
authorPascal Corpet <pascal.corpet@m4x.org>
Fri, 14 Jan 2005 10:50:57 +0000 (10:50 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:32 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-313

include/notifs.inc.php

index c28cefb..dffb1db 100644 (file)
@@ -104,7 +104,8 @@ function select_notifs_base($base_watch, $champ_w, $champ_u, $watcher, $watcher_
 function select_notifs($wuid, $details, $last, $wflag, $order) {
        $recent = ($last == 'watch_last');
 
-       $contactflag = "FIND_IN_SET('contacts', q.watch_flags)";
+       // équivalent de FIND_IN_SET('contacts', q.watch_flags) mais en plus rapide
+       $contactflag = "(q.watch_flags=1 OR q.watch_flags=3)";
 
        $where_clause = "";
        if ($wuid != 'all')