Comment 6 for bug 844877

Revision history for this message
Michal Hruby (mhr3) wrote :

And concluding:

SELECT subj_id, max(timestamp) AS timestamp
   FROM event_view
   WHERE (((subj_uri = 'application://gedit.desktop')
           OR (subj_uri = 'application://devhelp.desktop')
           OR (subj_uri = 'application://google-chrome.desktop') OR ...
   GROUP BY subj_id;

executes in 20seconds here.

On the other hand:
SELECT subj_id, max(timestamp) FROM event_view WHERE subj_id IN
   (SELECT id
      FROM uri
      WHERE (((value = 'application://gedit.desktop')
              OR (value = 'application://devhelp.desktop')
              OR (value = 'application://google-chrome.desktop') OR ...)
   GROUP BY subj_id;

executes immediately. Of course results are equivalent.