Skip to main content
improved query now with tag names as well
Source Link
rene
  • 42.3k
  • 55
  • 610
  • 777

[T]he more previous reviews a given task has had, the closer to the top of the queue it'll be. [...]
However, preference is also given to the most recently queued items

select concat(
      ;with taskresults as 'site://review/suggested-edits/'(
       ,select reviewtasks.idreviewtaskid
       , '| review forcount(*) '[all]
       , sum(case p.posttypeid 
     when ReviewTaskResultTypeId = 2 whenthen 1 thenelse 'Q:0 'end) [Approve]
       , sum(case when 2 then 'A: '
     ReviewTaskResultTypeId = 3 then when1 4else then0 'Excerpt:end) '[Reject]
       , sum(case when ReviewTaskResultTypeId = 5 then 'wiki:1 '
else 0 end) [Edit]
      else '?, '
sum(case when ReviewTaskResultTypeId = 19 then 1 else 0 end
 ) [Rej.Edt]
       , coalescesum(q.title, ' some tag') ) [Review Link]
  case when ReviewTaskResultTypeId ,= reviewtasks.creationdate
1 then 1 else 0 ,end) reviewtasks.deletiondate[Skip]
     , (select count(*) from reviewtaskresults 
 where reviewtaskid =group by reviewtasks.idreviewtaskid
) [# reviews]
     ,
select concat(
        select count(*)'site://review/suggested-edits/'
 from reviewtaskresults where reviewtaskid =  , reviewtasks.id
       , and'| ReviewTaskResultTypeIdreview =for 2'
        ) [Approve]
     , (
 case p.posttypeid  
     select count(*) from reviewtaskresults wherewhen reviewtaskid1 =then 'Q: reviewtasks.id'
        and ReviewTaskResultTypeIdwhen =2 3
then 'A: '
      ) [Reject]
  when 4 then ,'Excerpt: ('
        select count(*) from reviewtaskresults wherewhen reviewtaskid5 =then 'wiki: reviewtasks.id'
        and ReviewTaskResultTypeIdelse ='? 5'
        ) [Edit]end
   
       , coalesce(
 q.title, tw.tagname, te.tagname) ) [Review Link]
   select count(*) from, reviewtaskresultsreviewtasks.creationdate
 where reviewtaskid =  , reviewtasks.iddeletiondate
       , and ReviewTaskResultTypeId[all] =[# 19reviews]
     ,  [Approve]
 ) [Edit]   ,  [Reject]
       , (
 [Edit]    
    select count(*), from reviewtaskresults[Rej.Edt] where reviewtaskid =  reviewtasks.id
      ,  and[Skip] ReviewTaskResultTypeId = 1
     from reviewtasks
inner join )taskresults [Skip]rtr on rtr.reviewtaskid 
from= reviewtasks.id
inner join posts p on p.id = postid
inner join posts q on q.id = coalesce(p.parentid, p.id)
-- left outer join tags ttw on ttw.wikipostid = p.idpostid or
left touter join tags te on te.excerptpostid = p.idpostid
where reviewtasktypeid = 1 -- suggested edit
order by creationdate desc
       , deletiondate asc

[T]he more previous reviews a given task has had, the closer to the top of the queue it'll be.
However, preference is also given to the most recently queued items

select concat(
         'site://review/suggested-edits/'
       , reviewtasks.id
       , '| review for '
       , case p.posttypeid 
         when 1 then 'Q: '
         when 2 then 'A: '
         when 4 then 'Excerpt: '
         when 5 then 'wiki: '
         else '? '
         end
         , coalesce(q.title, ' some tag') ) [Review Link]
     , reviewtasks.creationdate
     , reviewtasks.deletiondate
     , (select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id) [# reviews]
     , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 2
        ) [Approve]
     , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 3
        ) [Reject]
     , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 5
        ) [Edit]   
       , (
         select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 19
        ) [Edit]     
       , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 1
        ) [Skip]   
from reviewtasks
inner join posts p on p.id = postid
inner join posts q on q.id = coalesce(p.parentid, p.id)
-- left outer join tags t on t.wikipostid = p.id or t.excerptpostid = p.id
where reviewtasktypeid = 1 -- suggested edit
order by creationdate desc
       , deletiondate asc

[T]he more previous reviews a given task has had, the closer to the top of the queue it'll be. [...]
However, preference is also given to the most recently queued items

;with taskresults as (
  select reviewtaskid
       , count(*) [all]
       , sum(case when ReviewTaskResultTypeId = 2 then 1 else 0 end) [Approve]
       , sum(case when ReviewTaskResultTypeId = 3 then 1 else 0 end) [Reject]
       , sum(case when ReviewTaskResultTypeId = 5 then 1 else 0 end) [Edit]
       , sum(case when ReviewTaskResultTypeId = 19 then 1 else 0 end) [Rej.Edt]
       , sum(case when ReviewTaskResultTypeId = 1 then 1 else 0 end) [Skip]
   from reviewtaskresults 
   group by reviewtaskid
)

select concat(
         'site://review/suggested-edits/'
       , reviewtasks.id
       , '| review for '
       , case p.posttypeid  
         when 1 then 'Q: '
         when 2 then 'A: '
         when 4 then 'Excerpt: '
         when 5 then 'wiki: '
         else '? '
         end
         , coalesce(q.title, tw.tagname, te.tagname) ) [Review Link]
     , reviewtasks.creationdate
     , reviewtasks.deletiondate
     ,  [all] [# reviews]
     ,  [Approve]
     ,  [Reject]
     ,  [Edit]    
     ,  [Rej.Edt]     
     ,  [Skip]   
from reviewtasks
inner join taskresults rtr on rtr.reviewtaskid = reviewtasks.id
inner join posts p on p.id = postid
inner join posts q on q.id = coalesce(p.parentid, p.id)
left outer join tags tw on tw.wikipostid = postid 
left outer join tags te on te.excerptpostid = postid
where reviewtasktypeid = 1 -- suggested edit
order by creationdate desc
       , deletiondate asc
added 413 characters in body
Source Link
rene
  • 42.3k
  • 55
  • 610
  • 777

I don't have insight on how the suggested edit queue is sorted but I have no reason to believe it is much different of what Shog9 laid out here for the Close Vote queue.

[T]he more previous reviews a given task has had, the closer to the top of the queue it'll be.
However, preference is also given to the most recently queued items

The Stack Exchange Data Explorer has the ReviewTasks and ReviewTaskResults tables with rows for each review queue. The only information missing is the user that did the review. For that you have to visit each review individually.

Keep in mind this data is refreshed once a week, on Sunday. It only returns 50,000 rows at once if you don't use trickery.

Additional background info on how the review system works: Review queues architecture wrap up

The Stack Exchange Data Explorer has the ReviewTasks and ReviewTaskResults tables with rows for each review queue. The only information missing is the user that did the review. For that you have to visit each review individually.

Keep in mind this data is refreshed once a week, on Sunday. It only returns 50,000 rows at once if you don't use trickery.

I don't have insight on how the suggested edit queue is sorted but I have no reason to believe it is much different of what Shog9 laid out here for the Close Vote queue.

[T]he more previous reviews a given task has had, the closer to the top of the queue it'll be.
However, preference is also given to the most recently queued items

The Stack Exchange Data Explorer has the ReviewTasks and ReviewTaskResults tables with rows for each review queue. The only information missing is the user that did the review. For that you have to visit each review individually.

Keep in mind this data is refreshed once a week, on Sunday. It only returns 50,000 rows at once if you don't use trickery.

Additional background info on how the review system works: Review queues architecture wrap up

Source Link
rene
  • 42.3k
  • 55
  • 610
  • 777

The Stack Exchange Data Explorer has the ReviewTasks and ReviewTaskResults tables with rows for each review queue. The only information missing is the user that did the review. For that you have to visit each review individually.

Here is a rough query to get you started:

select concat(
         'site://review/suggested-edits/'
       , reviewtasks.id
       , '| review for '
       , case p.posttypeid 
         when 1 then 'Q: '
         when 2 then 'A: '
         when 4 then 'Excerpt: '
         when 5 then 'wiki: '
         else '? '
         end
         , coalesce(q.title, ' some tag') ) [Review Link]
     , reviewtasks.creationdate
     , reviewtasks.deletiondate
     , (select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id) [# reviews]
     , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 2
        ) [Approve]
     , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 3
        ) [Reject]
     , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 5
        ) [Edit]   
      , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 19
        ) [Edit]     
       , (
        select count(*) from reviewtaskresults where reviewtaskid =  reviewtasks.id
        and ReviewTaskResultTypeId = 1
        ) [Skip]   
from reviewtasks
inner join posts p on p.id = postid
inner join posts q on q.id = coalesce(p.parentid, p.id)
-- left outer join tags t on t.wikipostid = p.id or t.excerptpostid = p.id
where reviewtasktypeid = 1 -- suggested edit
order by creationdate desc
       , deletiondate asc

Keep in mind this data is refreshed once a week, on Sunday. It only returns 50,000 rows at once if you don't use trickery.