On 31 Oct 2009, at 10:53, John McKerrell wrote:

        SELECT DISTINCT p.id FROM photos p LEFT OUTER JOIN moderators m ON
m.photo_id = p.id WHERE p.status = 'moderation' AND ( m.id IS NULL OR
m.user_id <> ?)

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.

John


I didn't think that would work because it will always link to
moderators if there's any available but I've realised that so long as
I put the DISTINCT bit in to make sure that it's not weighted towards
photos that are already part moderated, I should be ok. Anyone else
like to confirm or disagree? I did another version of the query using
subselects that I thought would be slower, and does appear to be. That
query is getting slightly fewer results which is a little confusing
but it's probably something simple:

        SELECT DISTINCT p.id FROM photos p WHERE status = 'moderation' AND id
NOT IN ( SELECT photo_id FROM moderators WHERE status = 'pending' AND
user_id = 1 );

John

On 31 Oct 2009, at 09:40, malenki wrote:

Right now as I lowered my counter to ~260 images quite often I get the
message mentioned in subject.
Also mostly I am served 1-3 pictures instead of the ~10 it used to be.
Is this just for having enlonged the fun to moderate the
photographs? ;)

regards
malenki


_______________________________________________
Photos mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/photos


_______________________________________________
Photos mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/photos

_______________________________________________
Photos mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/photos

Reply via email to