3

Is it possible to query on "data.stackexchange" for all reviews on a certain question/answer? If yes, how can I do it? If no, I request a feature.

Why? It would be very useful to learn about reviewing. There are sometimes questions which have a high view count, but low quality. It would be interesting/teaching to know why they weren't closed yet or have been reopened for some reasons.

1
  • You can query the PostHistory and PostHistoryTypes tables.
    – user247702
    Commented Sep 21, 2016 at 12:29

1 Answer 1

4

You can query the PostHistory table as indicated by Stijn. You're interested in the Close and Reopen events, recorded as posthistorytypeid's 10 and 11:

select top 1000 ph.postid [Post Link]
     , name
     , min(p.closeddate) [closed on]
     , min(p.score) [score]
     , sum( case when posthistorytypeid = 10 then 1 else 0 end) as closed
     , sum( case when posthistorytypeid = 11 then 1 else 0 end) as reopen
from posthistory ph
inner join posts p on p.id = ph.postid
inner join posthistorytypes pt on pt.id = ph.posthistorytypeid
where posthistorytypeid = 10 
or posthistorytypeid = 11
group by postid, name
order by sum( case when posthistorytypeid = 10 then 1 else 0 end)  desc

Another option is to query the reviewtasks table

select top 1000
       r.postid as [Post Link]
     , count(*) as [review tasks]
     , min(p.score) as score
     , min(p.viewcount) as views
     , rtt.name
from reviewtasks r
inner join reviewtasktypes rtt on rtt.id = r.reviewtasktypeid
inner join posts p on p.id = r.postid
where rtt.id in (2 ,6 ) -- close , reopen
group by postid 
    , rtt.name
order by count(*) desc

To find more info on which tables you can use see Database schema documentation for the public data dump and SEDE

If you're interested in your own review performance against your peers you can use the Consensus review script.

You can't find if a post is currently under review. That was available for a few days from the timeline but despite that some of us liked that feature the majority felt it gave posts an uneven chance for being reviewed by un-biased eyes so that feature was disabled. I have a very rough review post finder script here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .