-3

I know that the current Stack Overflow question list is about 15,250,000 long, but that only represents questions not marked as duplicates and those that are not deleted. But what is the size of the database containing all questions. I know one exist because you can undelete answers and then it shows back up in the question count.

What is the size of the database containing all questions?

1
  • If you say size, do you mean in bytes are just a count of posts?
    – rene
    Jan 25, 2018 at 16:30

1 Answer 1

11

Total number of posts and per posttype is

 | post type           | number of posts
0| grand total         | 48,327,688
1| Question            | 20,214,188
2| Answer              | 28,022,424
3| Wiki                |        167
4| TagWikiExcerpt      |     45,304
5| TagWiki             |     45,304
6| ModeratorNomination |        295
7| WikiPlaceholder     |          4
8| PrivilegeWiki       |          2

which you can find by querying SEDE

select 0
, 'grand total' [post type]
, count(*) [number of posts]
from postswithdeleted 
union
select pt.id
     , pt.name
     , count(*)
from postswithdeleted p
inner join posttypes pt on pt.id = p.posttypeid
group by pt.id, pt.name
order by 1

If you want to know an rough estimate size in bytes of the database to hold all data (including users, posthistory etc) you can run:

select name, type_desc, size
from sys.database_files

and for the SEDE database that will return

name              type_desc size     
----------------- --------- -------- 
StackOverflow     ROWS      51968512 
StackOverflow_log LOG       8720 

I assume the actual production database will be bigger but it would need a dev to tell us how much bigger in byte size it is.

And it is (much) bigger in production, thanks to @bluefeet:

StackOverflow       ROWS    358284928
StackOverflow_Log   LOG      49311744

production keeps tracks of a bit more data it seems.

10
  • Have you considered getting it unblocked?
    – Kevin B
    Jan 25, 2018 at 16:34
  • 13
    We can't fix the problems in your local infrastructure. Find a better school.
    – rene
    Jan 25, 2018 at 16:40
  • maybe later @rene
    – user9107868
    Jan 25, 2018 at 16:40
  • 2
    To add to the above, if I do a moderator-only deleted:1 is:question query, I get 5001369 results (with 15253495 results for is:question).
    – Brad Larson Mod
    Jan 25, 2018 at 16:48
  • @BradLarson that is way-off then. Either search is broken or my sql fu escaped me.
    – rene
    Jan 25, 2018 at 16:57
  • 3
    @rene - is:question shows only non-deleted questions. The sum of the two results is very close to what your query provides for questions (search will be more up-to-date than SEDE, so the small difference is understandable). I just wanted to show the deleted / visible breakdown from the search side.
    – Brad Larson Mod
    Jan 25, 2018 at 17:00
  • 2
    20,254,966 is what "is:q deleted:all" shows - so seems consistent to me... (Plus we passed 10million questions coming up 3 years ago and given the new questions asked each year - also seems to tie up) and deleted:all has 48,321,039 results Jan 25, 2018 at 17:08
  • @JonClements How does this draw you moderators attention?
    – user9107868
    Jan 25, 2018 at 17:21
  • @TheOne Moderators are humans too... for the most part... Jon is actually a ninja puppy but whatever, you get my point.
    – user4639281
    Jan 25, 2018 at 19:37
  • Ninja... Puppy... Got it... @TinyGiant
    – user9107868
    Jan 25, 2018 at 19:44

You must log in to answer this question.