OneAPI tag stats

2

Please login or register to vote for this query.

(click on this box to dismiss)

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

-- Hat tip: https://stackoverflow.com/a/20113055/1438
declare @tags table(Name  varchar(100) collate SQL_Latin1_General_CP1_CS_AS not null) -- Sigh: https://stackoverflow.com/a/1607623/1438
insert into @tags values ('intel-pytorch'),('intel-tensorflow'),('intel-dnn'),('intel-dal'),('dpc++'),('intel-hpc'),('intel-mxnet'),('intel-iot'),('intel-ccl'),('intel-advisor'),('intel-video-processing'),('intel-python'),('intel-rendering'),('intel-oneapi'),('intel-ai-analytics'),('intel-dl-frameworkstbb'),('intel-mkl'),('openvino'),('intel-mpi'),('vtunetbb'),('intel-mkl'),('openvino'),('intel-mpi'),('tbb'),('intel-mkl'),('openvino'),('intel-mpi'),('vtune');
--select * from Tags where TagName in (select Name from @tags);

select TagName,
       isnull(datediff(minute, q.CreationDate, min(a.CreationDate)), 
            9999999) TTA
into #answers
from Posts q
     join PostTags on q.Id = PostId
     join Tags t on t.Id = TagId 
     left join Posts a ON a.ParentId = q.Id 
                          and a.OwnerUserId <> q.OwnerUserId
where q.PostTypeId = 1
      and q.ClosedDate is null
      and q.Score >= 0
      and a.CreationDate > q.CreationDate
      and t.TagName in (select Name from @tags)
      and q.CreationDate > ##start?2019-11-17##
group by q.Id, q.CreationDate, TagName;

with median_answer as (
  select TagName,
         percentile_disc(0.5) 
                  within group (order by TTA)
                  over (partition by TagName)
               median_tta
  from #answers
),

medians as (
  select TagName, 
         -- http://stackoverflow.com/a/8846679/1438
         percentile_disc(0.5) 
                  within group (order by ViewCount)
                  over (partition by TagName)
               median_views,
               
         percentile_disc(0.5) 
                  within group (order by AnswerCount)
                  over (partition by TagName)
               median_answers,
               
         percentile_disc(0.5) 
                  within group (order by Score)
                  over (partition by TagName)
               median_score
  from Posts p
       join PostTags on p.Id = PostId
       join Tags t on t.Id = TagId
  where PostTypeId = 1
        and TagName in (select Name from @tags)
),

averages as (
  select TagName, 
         count(*) N,
         avg(ViewCount) avg_views,
         round(avg(1.0*Score), 1) avg_score,
         round(100.0*count(ClosedDate)/count(*), 1) closed_rate,
         round(avg(1.0*AnswerCount), 1) avg_answers,
         round(100.0*count(AcceptedAnswerId)/count(*), 1) accepted_rate,
         round(100.0*count(case 
                             when AnswerCount > 0 then 1 
                           end)/count(*), 1) answer_rate
  from Posts p
       join PostTags on p.Id = PostId
       join Tags t on t.Id = TagId
  where PostTypeId = 1
        and TagName in (select Name from @tags)
  group by TagName
)

select m.TagName, 
       N, 
       median_views,
       avg_score,
       closed_rate,
       avg_answers,
       accepted_rate,
       answer_rate,
       median_tta
from medians m
     join averages c on c.TagName = m.TagName
     join median_answer a on a.TagName = m.TagName
group by m.TagName, 
       N, 
       median_views,
       avg_score,
       closed_rate,
       avg_answers,
       accepted_rate,
       answer_rate,
       median_tta
order by median_tta

Enter Parameters

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