average time to complete suggested-edit reviews

1

Please login or register to vote for this query.

(click on this box to dismiss)

time in seconds between creation and completion (either approval or reject)

Stack Overflow

Q&A for professional and enthusiast programmers

declare @sql nvarchar(max)

create table #results (site sysname
                      , cnt bigint
                      , avg decimal
                      , min bigint
                      , max bigint
                      , var decimal
                      , stdev decimal)

select @sql = N'insert into #results' + string_agg(
concat(N'
select ''', convert(nvarchar(max),name), N'''
     , count(*) cnt
     , avg(datediff_big(s, creationdate, isnull(approvaldate, rejectiondate))) [avg]
     , min(datediff_big(s, creationdate, isnull(approvaldate, rejectiondate))) [min]
     , max(datediff_big(s, creationdate, isnull(approvaldate, rejectiondate))) [max]
     , var(datediff_big(s, creationdate, isnull(approvaldate, rejectiondate))) [var]
     , stdev(datediff_big(s, creationdate, isnull(approvaldate, rejectiondate))) [stdev]
     from ', convert(nvarchar(max),quotename(name)) ,N'.dbo.suggestededits
where (approvaldate is not null 
or rejectiondate is not null)
and datediff_big(s, creationdate, isnull(approvaldate, rejectiondate)) > -1
'),
N'union all')
from sys.databases
where database_id > 5
and (name not like '%.Meta' or name = 'StackExchange.meta')

print @sql

exec (@sql)

select * 
from #results
order by [avg]

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results