I was curious about the ratio on StackOverflow of posts reopened to posts closed (considering history only, ignoring their current state), and the ratio of posts undeleted to posts deleted. So I figured I'd just count the number of posts associated with each kind of history:
I got the legend for PostHistoryTypeId from here
Database schema documentation for the public data dump and SEDE
[UPDATE: That posts is from May 2012, so I assumed it was valid, but is it outdated? Looking at the query results again, I see 38 different PostHistoryTypeIds, but only 22 in the legend I got from that post.]
But something appears to be wrong.
According to my query, I get:
Number of Posts Closed - 91075
Number of Posts Reopened - 2985
Number of Posts Deleted - 58518
Number of Posts Undeleted - 58620
The reopen/close ratio seems plausible. But according to this, more posts have been undeleted than posts deleted, which would imply that there have been some posts undeleted without having been deleted in the first place. Seems unlikely. Anyone see where I'm going wrong here?
[UPDATE: @lbstr in the comments points out that these numbers might be aggregates of individual user's votes rather than actions on the post. I interpreted "A post was voted to be closed", for example, to mean "This post garnered enough close votes to be closed", rather than "A close vote was cast on this post". Does it actually mean the latter?]