Effect of the post score to the delay until the next post of the same type

1

Please login or register to vote for this query.

(click on this box to dismiss)

Both scale a base2 log

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

WITH Raw AS (
  SELECT
    Id,
    PostTypeId,
    DATEDIFF(s, CreationDate, LAG(CreationDate) OVER
      (PARTITION BY OwnerUserId, PostTypeId ORDER BY CreationDate DESC)
    ) AS SecToNext,
    CASE
      WHEN ClosedDate IS NOT NULL OR Score < 0 THEN -1
      WHEN Score > 0 THEN 1
      ELSE 0
    END AS Sign
  FROM Posts
  WHERE
    PostTypeId <= 2
    AND
    OwnerUserId > 0
),
Raw2 AS (
  SELECT
    FLOOR(LOG(SecToNext) / LOG(##LogBaseX:float?2##)) AS LogSecToNext,
    CASE WHEN PostTypeId = 1 THEN 'Question' ELSE 'Answer' END + ', ' +
    CASE
      WHEN Sign = 1 THEN 'Positive'
      WHEN Sign = -1 THEN 'Negative'
      ELSE 'Neutral'
    END AS PostType
  FROM Raw
  WHERE SecToNext > 0
)
SELECT
  LogSecToNext,
  PostType,
  LOG(COUNT(*))/LOG(##LogBaseY:float?2##) AS LogCount
FROM Raw2
GROUP BY PostType, LogSecToNext
ORDER BY PostType, LogSecToNext

Enter Parameters

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