39.2% on 2022-07-03, out of 4.582m first posts.
This does not include deleted posts (only the first post non-deleted post). It does not include users who did not post at all. It only counts first questions, not answers or any other type of post.
The query is as follows:
SELECT
GoodFirstQuestions = COUNT(IsGoodQuestion),
NotGoodFirstQuestions = COUNT(*) - COUNT(IsGoodQuestion),
TotalUsers = COUNT(*),
PercentUsersGoodQ = COUNT(IsGoodQuestion) * 1.0 / COUNT(*)
FROM (
SELECT
p.*,
rn = ROW_NUMBER() OVER (PARTITION BY p.OwnerUserId ORDER BY p.CreationDate)
FROM Posts p
WHERE
p.PostTypeId = 1
) p
LEFT JOIN (
SELECT
v.PostId,
upvotes = COUNT(CASE WHEN v.VoteTypeId = 2 THEN 1 END),
downvotes = COUNT(CASE WHEN v.VoteTypeId = 3 THEN 1 END)
FROM Votes v
WHERE v.VoteTypeId IN (2, 3)
GROUP BY
v.PostId
) v ON v.PostId = p.Id
CROSS APPLY (SELECT IsGoodQuestion =
CASE WHEN p.ClosedDate IS NULL AND
v.upvotes > 0 AND
v.downvotes = 0
THEN 1 END
) calc
WHERE p.rn = 1;
SEDE link
Took a few goes to get this to run without timing out, but the execution plan looks OK now.
- Begin by taking all
Posts
with PostTypeId=1
i.e. a question.
- Compute a row-number, partitioned by
OwnerUserId
and ordered by CreationDate
of the post.
- Left-join grouped up
Votes
for the post
VoteTypeId IN (2, 3)
meaning up and down-votes respectively
- Pivot them up per post using conditional
COUNT
- Create a virtual column
IsGoodQuestion
- Filter by Row-Number = 1
- Finally do a total count and percentage.
@Trilarion's comment helps us a lot. Roomba deletes most bad posts within 7 or 30 days.
So looking at only data since last Monday (SEDE refreshes every Sunday morning), we get the following result:
12.3% on 2022-07-03, out of 10,196 first posts in the last week
SEDE link
These numbers make far more sense, given the sheer volume of **** that comes into Stack Overflow on a regular basis.
There is a possible bug here if you try this yourself: make sure you first work out all users' first posts by row-number, before you filter down by date, otherwise you will only get the first post of a user in that week.