<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 31 Oct 2009, at 10:53, John McKerrell wrote:</div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font><span class="Apple-tab-span" style="white-space:pre"> </span>SELECT DISTINCT p.id FROM photos p LEFT OUTER JOIN moderators m ON <br>m.photo_id = p.id WHERE p.status = 'moderation' AND ( m.id IS NULL OR <br>m.user_id <> ?)<br></div></blockquote><div><br></div>I've just realised this isn't going to work, if someone else has moderated a photo then it will be offered back to you, I'll need to use the version below. Doesn't seem too slow right now, might get that way when there's more users but should be fine for now.</div><div><br></div><div>John</div><div><br><blockquote type="cite"><div><br>I didn't think that would work because it will always link to <br>moderators if there's any available but I've realised that so long as <br>I put the DISTINCT bit in to make sure that it's not weighted towards <br>photos that are already part moderated, I should be ok. Anyone else <br>like to confirm or disagree? I did another version of the query using <br>subselects that I thought would be slower, and does appear to be. That <br>query is getting slightly fewer results which is a little confusing <br>but it's probably something simple:<br><br><span class="Apple-tab-span" style="white-space:pre"> </span>SELECT DISTINCT p.id FROM photos p WHERE status = 'moderation' AND id <br>NOT IN ( SELECT photo_id FROM moderators WHERE status = 'pending' AND <br>user_id = 1 );<br><br>John<br><br>On 31 Oct 2009, at 09:40, malenki wrote:<br><br><blockquote type="cite">Right now as I lowered my counter to ~260 images quite often I get the<br></blockquote><blockquote type="cite">message mentioned in subject.<br></blockquote><blockquote type="cite">Also mostly I am served 1-3 pictures instead of the ~10 it used to be.<br></blockquote><blockquote type="cite">Is this just for having enlonged the fun to moderate the <br></blockquote><blockquote type="cite">photographs? ;)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">regards<br></blockquote><blockquote type="cite">malenki<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">Photos mailing list<br></blockquote><blockquote type="cite"><a href="mailto:Photos@openstreetmap.org">Photos@openstreetmap.org</a><br></blockquote><blockquote type="cite"><a href="http://lists.openstreetmap.org/listinfo/photos">http://lists.openstreetmap.org/listinfo/photos</a><br></blockquote><br><br>_______________________________________________<br>Photos mailing list<br><a href="mailto:Photos@openstreetmap.org">Photos@openstreetmap.org</a><br>http://lists.openstreetmap.org/listinfo/photos<br></div></blockquote></div><br></body></html>