HNQ update

This commit is contained in:
Glorfindel 2018-11-10 14:22:14 +01:00
parent 857b3e2a27
commit a7be305b21
4 changed files with 62 additions and 54 deletions

View file

@ -2,7 +2,7 @@ site,question,timestamp,hotness,calculated_hotness,calculated_traffic_factor,vie
history,49243,2018-11-08 23:45:00,161.908,4.49861102725452,35.9906644560047,5873,12954
codegolf,175485,2018-11-08 23:45:00,122.779,3.65374374432519,33.6036155219408,1479,5854
security,197236,2018-11-08 23:45:00,118.193,3.28040308536082,36.0300234222587,3394,65844
workplace,122351,2018-11-08 23:45:00,95.202,2.89352910093873,32.9016908691584,2304,43644
workplace,122351,2018-11-08 23:45:00,95.202,3.536535567814,26.9195652565842,2304,43644
writing,39988,2018-11-08 23:45:00,94.765,2.62750732565308,36.0665026790917,2106,10607
worldbuilding,129621,2018-11-08 23:45:00,87.784,2.11622381503254,41.4814347029027,604,16364
space,31898,2018-11-08 23:45:00,79.908,2.21347586827745,36.1006872246524,2418,8506
@ -18,11 +18,11 @@ ell,184991,2018-11-08 23:45:00,52.679,1.51517046835114,34.7677050868917,4007,134
tex,458975,2018-11-08 23:45:00,52.169,1.44228332322318,36.1711178102053,327,115906
scifi,198138,2018-11-08 23:45:00,47.946,1.29082766942969,37.143610363716,3077,74500
academia,119774,2018-11-08 23:45:00,45.784,1.09066919697831,41.9778977226497,125,39532
workplace,122337,2018-11-08 23:45:00,43.022,1.54250677934032,27.8909633177749,3122,43644
workplace,122337,2018-11-08 23:45:00,43.022,1.88528606363817,22.8198790781795,3122,43644
codereview,207240,2018-11-08 23:45:00,42.523,1.23316330560534,34.4828619264877,181,88002
judaism,96770,2018-11-08 23:45:00,40.451,0.960440039130155,42.1171529215248,104,4672
writing,39965,2018-11-08 23:45:00,39.442,1.29123501660687,30.5459498021098,3496,10607
stackoverflow,53215736,2018-11-08 23:45:00,39.400,1.88832278879827,20.8650767939279,78,9837321
stackoverflow,53215736,2018-11-08 23:45:00,39.400,0.472080697199567,83.4603071757116,78,9837321
electronics,405687,2018-11-08 23:45:00,39.050,1.07488936049444,36.3293204260923,994,116661
ell,185051,2018-11-08 23:45:00,37.868,1.13950513117137,33.2319697069491,297,134802
boardgames,43952,2018-11-08 23:45:00,37.190,1.0757382027621,34.5716085052196,359,14154
@ -37,7 +37,7 @@ english,472044,2018-11-08 23:45:00,32.419,0.891846692621097,36.3504179229751,862
aviation,56891,2018-11-08 23:45:00,31.828,0.944161394399135,33.7103382841186,573,29518
codegolf,175516,2018-11-08 23:45:00,30.494,1.0589650736723,28.7960394144561,624,5854
puzzling,74862,2018-11-08 23:45:00,29.588,1.02711650002802,28.8068588122114,610,13375
workplace,122241,2018-11-08 23:45:00,29.529,1.11603984831684,26.4587326738684,14277,43644
workplace,122241,2018-11-08 23:45:00,29.529,1.36404870349836,21.6480540058923,14277,43644
unix,480520,2018-11-08 23:45:00,28.946,0.77630195504163,37.2870373596415,325,349353
codereview,207171,2018-11-08 23:45:00,28.689,0.9474332506701,30.2807611826046,2432,88002
politics,35176,2018-11-08 23:45:00,28.561,0.740643496039403,38.562412486885,6508,15048
@ -46,9 +46,9 @@ askubuntu,1091069,2018-11-08 23:45:00,27.578,0.745661988637793,36.9845860728138,
worldbuilding,129614,2018-11-08 23:45:00,27.363,1.3348488679436,20.4989498490222,548,16364
travel,125296,2018-11-08 23:45:00,26.276,0.676731240589597,38.8278217762006,6407,58416
security,197169,2018-11-08 23:45:00,25.788,0.97385395797441,26.4803565142748,9018,65844
workplace,122361,2018-11-08 23:45:00,25.693,1.04753078844111,24.527202716624,728,43644
workplace,122361,2018-11-08 23:45:00,25.693,1.28031540809469,20.0677113136014,728,43644
academia,119577,2018-11-08 23:45:00,25.451,0.964958509882148,26.375227265583,23038,39532
stackoverflow,53211917,2018-11-08 23:45:00,25.324,1.85761621355017,13.6325252844355,467,9837321
stackoverflow,53211917,2018-11-08 23:45:00,25.324,0.464404053387542,54.530101137742,467,9837321
worldbuilding,129489,2018-11-08 23:45:00,25.187,1.15625,21.7833513513513,4216,16364
retrocomputing,8208,2018-11-08 23:45:00,24.595,0.759463199185152,32.3847159762166,1175,2040
chess,22824,2018-11-08 23:45:00,24.217,0.682845107641099,35.4648510020934,1032,3358
@ -72,7 +72,7 @@ electronics,405520,2018-11-08 23:45:00,17.868,0.603682858204162,29.5983226244883
reverseengineering,19848,2018-11-08 23:45:00,17.077,0.454551140505342,37.5689300460557,1241,5545
academia,119614,2018-11-08 23:45:00,17.046,0.710240395442039,24.000324551226,9318,39532
stats,376020,2018-11-08 23:45:00,17.020,0.56410661852159,30.1716013270789,179,135032
softwareengineering,381047,2018-11-08 23:45:00,16.484,0.420433724171498,39.2071307611757,13204,77307
softwareengineering,381047,2018-11-08 23:45:00,16.484,0.513863440654053,32.0785615318711,13204,77307
travel,125356,2018-11-08 23:45:00,16.321,0.561329211605516,29.0756291719054,1494,58416
politics,35240,2018-11-08 23:45:00,16.207,0.472080697199567,34.3309948831665,147,15048
puzzling,74851,2018-11-08 23:45:00,16.110,0.777550160029687,20.7189205637678,1070,13375
@ -83,7 +83,7 @@ academia,119396,2018-11-08 23:45:00,15.129,0.675510119695094,22.3964076316559,26
salesforce,238786,2018-11-08 23:45:00,15.118,0.341851539351411,44.2238757464223,233,46708
physics,439511,2018-11-08 23:45:00,15.070,0.600782959115698,25.0839338422344,6726,102997
biology,78792,2018-11-08 23:45:00,15.032,0.38571151857222,38.9721314407297,6029,31022
workplace,122320,2018-11-08 23:45:00,14.857,0.72734180060124,20.4264349824509,1100,43644
workplace,122320,2018-11-08 23:45:00,14.857,0.88897331184596,16.7125377129144,1100,43644
graphicdesign,116862,2018-11-08 23:45:00,14.651,0.376157389606934,38.9491218431455,4940,65959
skeptics,42692,2018-11-08 23:45:00,14.379,0.458887394531529,31.3344846063581,24087,11354
german,47857,2018-11-08 23:45:00,14.253,0.374138384105758,38.0955299041734,1713,13668
@ -94,7 +94,7 @@ politics,35199,2018-11-08 23:45:00,13.547,0.546953133405022,24.7681184595543,386
ell,185030,2018-11-08 23:45:00,13.433,0.692072744230843,19.4098093184253,358,134802
worldbuilding,129336,2018-11-08 23:45:00,13.191,0.669317989171688,19.7081211224047,9578,16364
english,472009,2018-11-08 23:45:00,12.998,0.507582106897632,25.6076796706733,826,471776
stackoverflow,53214900,2018-11-08 23:45:00,12.697,0.937649936506727,13.5413009756109,47,9837321
stackoverflow,53214900,2018-11-08 23:45:00,12.697,0.234412484126682,54.1652039024434,47,9837321
bicycles,57914,2018-11-08 23:45:00,12.604,0.319464292419719,39.4535486408622,6643,17456
physics,439604,2018-11-08 23:45:00,12.521,0.534024605784247,23.4464851701209,3422,102997
mathoverflow,314613,2018-11-08 23:45:00,12.498,0.316680550216508,39.4656381374081,2026,18246

1 site question timestamp hotness calculated_hotness calculated_traffic_factor views traffic
2 history 49243 2018-11-08 23:45:00 161.908 4.49861102725452 35.9906644560047 5873 12954
3 codegolf 175485 2018-11-08 23:45:00 122.779 3.65374374432519 33.6036155219408 1479 5854
4 security 197236 2018-11-08 23:45:00 118.193 3.28040308536082 36.0300234222587 3394 65844
5 workplace 122351 2018-11-08 23:45:00 95.202 2.89352910093873 3.536535567814 32.9016908691584 26.9195652565842 2304 43644
6 writing 39988 2018-11-08 23:45:00 94.765 2.62750732565308 36.0665026790917 2106 10607
7 worldbuilding 129621 2018-11-08 23:45:00 87.784 2.11622381503254 41.4814347029027 604 16364
8 space 31898 2018-11-08 23:45:00 79.908 2.21347586827745 36.1006872246524 2418 8506
18 tex 458975 2018-11-08 23:45:00 52.169 1.44228332322318 36.1711178102053 327 115906
19 scifi 198138 2018-11-08 23:45:00 47.946 1.29082766942969 37.143610363716 3077 74500
20 academia 119774 2018-11-08 23:45:00 45.784 1.09066919697831 41.9778977226497 125 39532
21 workplace 122337 2018-11-08 23:45:00 43.022 1.54250677934032 1.88528606363817 27.8909633177749 22.8198790781795 3122 43644
22 codereview 207240 2018-11-08 23:45:00 42.523 1.23316330560534 34.4828619264877 181 88002
23 judaism 96770 2018-11-08 23:45:00 40.451 0.960440039130155 42.1171529215248 104 4672
24 writing 39965 2018-11-08 23:45:00 39.442 1.29123501660687 30.5459498021098 3496 10607
25 stackoverflow 53215736 2018-11-08 23:45:00 39.400 1.88832278879827 0.472080697199567 20.8650767939279 83.4603071757116 78 9837321
26 electronics 405687 2018-11-08 23:45:00 39.050 1.07488936049444 36.3293204260923 994 116661
27 ell 185051 2018-11-08 23:45:00 37.868 1.13950513117137 33.2319697069491 297 134802
28 boardgames 43952 2018-11-08 23:45:00 37.190 1.0757382027621 34.5716085052196 359 14154
37 aviation 56891 2018-11-08 23:45:00 31.828 0.944161394399135 33.7103382841186 573 29518
38 codegolf 175516 2018-11-08 23:45:00 30.494 1.0589650736723 28.7960394144561 624 5854
39 puzzling 74862 2018-11-08 23:45:00 29.588 1.02711650002802 28.8068588122114 610 13375
40 workplace 122241 2018-11-08 23:45:00 29.529 1.11603984831684 1.36404870349836 26.4587326738684 21.6480540058923 14277 43644
41 unix 480520 2018-11-08 23:45:00 28.946 0.77630195504163 37.2870373596415 325 349353
42 codereview 207171 2018-11-08 23:45:00 28.689 0.9474332506701 30.2807611826046 2432 88002
43 politics 35176 2018-11-08 23:45:00 28.561 0.740643496039403 38.562412486885 6508 15048
46 worldbuilding 129614 2018-11-08 23:45:00 27.363 1.3348488679436 20.4989498490222 548 16364
47 travel 125296 2018-11-08 23:45:00 26.276 0.676731240589597 38.8278217762006 6407 58416
48 security 197169 2018-11-08 23:45:00 25.788 0.97385395797441 26.4803565142748 9018 65844
49 workplace 122361 2018-11-08 23:45:00 25.693 1.04753078844111 1.28031540809469 24.527202716624 20.0677113136014 728 43644
50 academia 119577 2018-11-08 23:45:00 25.451 0.964958509882148 26.375227265583 23038 39532
51 stackoverflow 53211917 2018-11-08 23:45:00 25.324 1.85761621355017 0.464404053387542 13.6325252844355 54.530101137742 467 9837321
52 worldbuilding 129489 2018-11-08 23:45:00 25.187 1.15625 21.7833513513513 4216 16364
53 retrocomputing 8208 2018-11-08 23:45:00 24.595 0.759463199185152 32.3847159762166 1175 2040
54 chess 22824 2018-11-08 23:45:00 24.217 0.682845107641099 35.4648510020934 1032 3358
72 reverseengineering 19848 2018-11-08 23:45:00 17.077 0.454551140505342 37.5689300460557 1241 5545
73 academia 119614 2018-11-08 23:45:00 17.046 0.710240395442039 24.000324551226 9318 39532
74 stats 376020 2018-11-08 23:45:00 17.020 0.56410661852159 30.1716013270789 179 135032
75 softwareengineering 381047 2018-11-08 23:45:00 16.484 0.420433724171498 0.513863440654053 39.2071307611757 32.0785615318711 13204 77307
76 travel 125356 2018-11-08 23:45:00 16.321 0.561329211605516 29.0756291719054 1494 58416
77 politics 35240 2018-11-08 23:45:00 16.207 0.472080697199567 34.3309948831665 147 15048
78 puzzling 74851 2018-11-08 23:45:00 16.110 0.777550160029687 20.7189205637678 1070 13375
83 salesforce 238786 2018-11-08 23:45:00 15.118 0.341851539351411 44.2238757464223 233 46708
84 physics 439511 2018-11-08 23:45:00 15.070 0.600782959115698 25.0839338422344 6726 102997
85 biology 78792 2018-11-08 23:45:00 15.032 0.38571151857222 38.9721314407297 6029 31022
86 workplace 122320 2018-11-08 23:45:00 14.857 0.72734180060124 0.88897331184596 20.4264349824509 16.7125377129144 1100 43644
87 graphicdesign 116862 2018-11-08 23:45:00 14.651 0.376157389606934 38.9491218431455 4940 65959
88 skeptics 42692 2018-11-08 23:45:00 14.379 0.458887394531529 31.3344846063581 24087 11354
89 german 47857 2018-11-08 23:45:00 14.253 0.374138384105758 38.0955299041734 1713 13668
94 ell 185030 2018-11-08 23:45:00 13.433 0.692072744230843 19.4098093184253 358 134802
95 worldbuilding 129336 2018-11-08 23:45:00 13.191 0.669317989171688 19.7081211224047 9578 16364
96 english 472009 2018-11-08 23:45:00 12.998 0.507582106897632 25.6076796706733 826 471776
97 stackoverflow 53214900 2018-11-08 23:45:00 12.697 0.937649936506727 0.234412484126682 13.5413009756109 54.1652039024434 47 9837321
98 bicycles 57914 2018-11-08 23:45:00 12.604 0.319464292419719 39.4535486408622 6643 17456
99 physics 439604 2018-11-08 23:45:00 12.521 0.534024605784247 23.4464851701209 3422 102997
100 mathoverflow 314613 2018-11-08 23:45:00 12.498 0.316680550216508 39.4656381374081 2026 18246

View file

@ -1,14 +1,14 @@
SELECT q.site, q.question, q.timestamp, q.hotness,
SELECT q.site, q.question, q.hotness,
(LEAST(COUNT(a.*), 10) * (q.up_votes - q.down_votes) / 5.0 + SUM(a.up_votes - a.down_votes)) /
(GREATEST(DATE_PART('day', q.timestamp - qq.createddate) * 24 +
DATE_PART('hour', q.timestamp - qq.createddate) + 1, 6) ^ 1.4) *
CASE q.site WHEN 'workplace' THEN 0.45 WHEN 'softwareengineering' THEN 0.45 WHEN 'stackoverflow' THEN 0.8 ELSE 1 END
CASE q.site WHEN 'workplace' THEN 0.55 WHEN 'softwareengineering' THEN 0.55 WHEN 'stackoverflow' THEN 0.2 ELSE 1 END
AS calculated_hotness,
q.hotness / (
(LEAST(COUNT(a.*), 10) * (q.up_votes - q.down_votes) / 5.0 + SUM(a.up_votes - a.down_votes)) /
(GREATEST(DATE_PART('day', q.timestamp - qq.createddate) * 24 +
DATE_PART('hour', q.timestamp - qq.createddate) + 1, 6) ^ 1.4) *
CASE q.site WHEN 'workplace' THEN 0.45 WHEN 'softwareengineering' THEN 0.45 WHEN 'stackoverflow' THEN 0.8 ELSE 1 END)
CASE q.site WHEN 'workplace' THEN 0.55 WHEN 'softwareengineering' THEN 0.55 WHEN 'stackoverflow' THEN 0.2 ELSE 1 END)
AS calculated_traffic_factor,
q.views, s.visits AS traffic

View file

@ -1,40 +1,40 @@
site,question,timestamp,hotness,calculated_hotness,calculated_traffic_factor,traffic,views
history,49243,2018-11-08 23:45:00,161.908,4.49861102725452,35.9906644560047,12954,5873
history,49243,2018-11-08 23:30:00,161.908,4.49861102725452,35.9906644560047,12954,5803
history,49243,2018-11-08 23:15:00,161.908,5.21361467320568,31.054845850441,12954,5740
history,49243,2018-11-08 23:00:00,179.417,5.21361467320568,34.4131684533721,12954,5663
history,49243,2018-11-08 22:45:00,176.217,5.06597248776977,34.7844368332875,12954,5597
history,49243,2018-11-08 22:30:00,169.817,4.9275579389236,34.462709947779,12954,5493
history,49243,2018-11-08 22:15:00,169.817,5.75651559979562,29.4999634859027,12954,5407
history,49243,2018-11-08 22:00:00,200.258,5.70210618958961,35.1200053702284,12954,5293
history,49243,2018-11-08 21:45:00,200.258,5.70210618958961,35.1200053702284,12954,5177
history,49243,2018-11-08 21:30:00,196.448,5.64769677938361,34.7837371009568,12954,5037
history,49243,2018-11-08 21:15:00,192.258,6.66432935369693,28.8488143061759,12954,4914
history,49243,2018-11-08 21:00:00,219.856,6.53314176799423,33.6524153014819,12954,4792
history,49243,2018-11-08 20:45:00,217.634,6.46754797514289,33.6501562626896,12954,4678
history,49243,2018-11-08 20:30:00,210.967,6.33636038944019,33.2946655546274,12954,4552
history,49243,2018-11-08 20:15:00,206.523,7.61840573411716,27.1084275644624,12954,4433
history,49243,2018-11-08 20:00:00,257.428,7.83002811562041,32.8770211548088,12954,4321
history,49243,2018-11-08 19:45:00,257.428,7.83002811562041,32.8770211548088,12954,4179
history,49243,2018-11-08 19:30:00,231.294,7.11376774745555,32.5135720213426,12954,4040
history,49243,2018-11-08 19:15:00,228.628,6.95098130014536,32.8914710208211,12954,3914
history,49243,2018-11-08 19:00:00,282.451,6.86958807649026,41.1161479924291,12954,3782
history,49243,2018-11-08 18:45:00,275.784,6.70680162918006,41.1200472666605,12954,3638
history,49243,2018-11-08 18:30:00,269.118,6.54401518186987,41.1242933460162,12954,3485
history,49243,2018-11-08 18:15:00,262.451,6.38122873455967,41.1285993524428,12954,3327
history,49243,2018-11-08 18:00:00,251.118,6.10449177413234,41.1365940509753,12954,3166
history,49243,2018-11-08 17:45:00,239.784,5.827754813705,41.1451764298843,12954,3027
history,49243,2018-11-08 17:30:00,233.118,5.66496836639481,41.1508034860143,12954,2879
history,49243,2018-11-08 17:15:00,223.118,5.50218191908461,40.5508220704414,12954,2692
history,49243,2018-11-08 17:00:00,208.451,5.06265851134709,41.1742169717338,12954,2528
history,49243,2018-11-08 16:45:00,193.784,4.78592155091975,40.490425498671,12954,2334
history,49243,2018-11-08 16:30:00,172.451,4.37895543264426,39.3817664172627,12954,2143
history,49243,2018-11-08 16:15:00,141.784,3.43479403824513,41.2787487171833,12954,1912
history,49243,2018-11-08 16:00:00,123.784,3.0766638541627,40.2331895414968,12954,1654
history,49243,2018-11-08 15:45:00,74.451,1.79065092041215,41.5776180333706,12954,1399
history,49243,2018-11-08 15:30:00,63.784,1.53019260471584,41.6836415255352,12954,1172
history,49243,2018-11-08 15:15:00,57.784,1.46507802579176,39.4409027934005,12954,937
history,49243,2018-11-08 15:00:00,51.118,1.22089835482647,41.869169368539,12954,722
history,49243,2018-11-08 14:45:00,35.784,0.846489526013018,42.2734114248801,12954,526
history,49243,2018-11-08 14:30:00,19.784,0.455802052468548,43.4048067419906,12954,347
history,49243,2018-11-08 14:15:00,19.784,0.455802052468548,43.4048067419906,12954,197
timestamp,hotness,calculated_hotness,calculated_traffic_factor,views,traffic
2018-11-08 23:45:00,161.908,4.49861102725452,35.9906644560047,5873,12954
2018-11-08 23:30:00,161.908,4.49861102725452,35.9906644560047,5803,12954
2018-11-08 23:15:00,161.908,5.21361467320568,31.054845850441,5740,12954
2018-11-08 23:00:00,179.417,5.21361467320568,34.4131684533721,5663,12954
2018-11-08 22:45:00,176.217,5.06597248776977,34.7844368332875,5597,12954
2018-11-08 22:30:00,169.817,4.9275579389236,34.462709947779,5493,12954
2018-11-08 22:15:00,169.817,5.75651559979562,29.4999634859027,5407,12954
2018-11-08 22:00:00,200.258,5.70210618958961,35.1200053702284,5293,12954
2018-11-08 21:45:00,200.258,5.70210618958961,35.1200053702284,5177,12954
2018-11-08 21:30:00,196.448,5.64769677938361,34.7837371009568,5037,12954
2018-11-08 21:15:00,192.258,6.66432935369693,28.8488143061759,4914,12954
2018-11-08 21:00:00,219.856,6.53314176799423,33.6524153014819,4792,12954
2018-11-08 20:45:00,217.634,6.46754797514289,33.6501562626896,4678,12954
2018-11-08 20:30:00,210.967,6.33636038944019,33.2946655546274,4552,12954
2018-11-08 20:15:00,206.523,7.61840573411716,27.1084275644624,4433,12954
2018-11-08 20:00:00,257.428,7.83002811562041,32.8770211548088,4321,12954
2018-11-08 19:45:00,257.428,7.83002811562041,32.8770211548088,4179,12954
2018-11-08 19:30:00,231.294,7.11376774745555,32.5135720213426,4040,12954
2018-11-08 19:15:00,228.628,6.95098130014536,32.8914710208211,3914,12954
2018-11-08 19:00:00,282.451,6.86958807649026,41.1161479924291,3782,12954
2018-11-08 18:45:00,275.784,6.70680162918006,41.1200472666605,3638,12954
2018-11-08 18:30:00,269.118,6.54401518186987,41.1242933460162,3485,12954
2018-11-08 18:15:00,262.451,6.38122873455967,41.1285993524428,3327,12954
2018-11-08 18:00:00,251.118,6.10449177413234,41.1365940509753,3166,12954
2018-11-08 17:45:00,239.784,5.827754813705,41.1451764298843,3027,12954
2018-11-08 17:30:00,233.118,5.66496836639481,41.1508034860143,2879,12954
2018-11-08 17:15:00,223.118,5.50218191908461,40.5508220704414,2692,12954
2018-11-08 17:00:00,208.451,5.06265851134709,41.1742169717338,2528,12954
2018-11-08 16:45:00,193.784,4.78592155091975,40.490425498671,2334,12954
2018-11-08 16:30:00,172.451,4.37895543264426,39.3817664172627,2143,12954
2018-11-08 16:15:00,141.784,3.43479403824513,41.2787487171833,1912,12954
2018-11-08 16:00:00,123.784,3.0766638541627,40.2331895414968,1654,12954
2018-11-08 15:45:00,74.451,1.79065092041215,41.5776180333706,1399,12954
2018-11-08 15:30:00,63.784,1.53019260471584,41.6836415255352,1172,12954
2018-11-08 15:15:00,57.784,1.46507802579176,39.4409027934005,937,12954
2018-11-08 15:00:00,51.118,1.22089835482647,41.869169368539,722,12954
2018-11-08 14:45:00,35.784,0.846489526013018,42.2734114248801,526,12954
2018-11-08 14:30:00,19.784,0.455802052468548,43.4048067419906,347,12954
2018-11-08 14:15:00,19.784,0.455802052468548,43.4048067419906,197,12954

1 site timestamp question hotness calculated_hotness calculated_traffic_factor views traffic
2 history 2018-11-08 23:45:00 49243 161.908 4.49861102725452 35.9906644560047 5873 12954
3 history 2018-11-08 23:30:00 49243 161.908 4.49861102725452 35.9906644560047 5803 12954
4 history 2018-11-08 23:15:00 49243 161.908 5.21361467320568 31.054845850441 5740 12954
5 history 2018-11-08 23:00:00 49243 179.417 5.21361467320568 34.4131684533721 5663 12954
6 history 2018-11-08 22:45:00 49243 176.217 5.06597248776977 34.7844368332875 5597 12954
7 history 2018-11-08 22:30:00 49243 169.817 4.9275579389236 34.462709947779 5493 12954
8 history 2018-11-08 22:15:00 49243 169.817 5.75651559979562 29.4999634859027 5407 12954
9 history 2018-11-08 22:00:00 49243 200.258 5.70210618958961 35.1200053702284 5293 12954
10 history 2018-11-08 21:45:00 49243 200.258 5.70210618958961 35.1200053702284 5177 12954
11 history 2018-11-08 21:30:00 49243 196.448 5.64769677938361 34.7837371009568 5037 12954
12 history 2018-11-08 21:15:00 49243 192.258 6.66432935369693 28.8488143061759 4914 12954
13 history 2018-11-08 21:00:00 49243 219.856 6.53314176799423 33.6524153014819 4792 12954
14 history 2018-11-08 20:45:00 49243 217.634 6.46754797514289 33.6501562626896 4678 12954
15 history 2018-11-08 20:30:00 49243 210.967 6.33636038944019 33.2946655546274 4552 12954
16 history 2018-11-08 20:15:00 49243 206.523 7.61840573411716 27.1084275644624 4433 12954
17 history 2018-11-08 20:00:00 49243 257.428 7.83002811562041 32.8770211548088 4321 12954
18 history 2018-11-08 19:45:00 49243 257.428 7.83002811562041 32.8770211548088 4179 12954
19 history 2018-11-08 19:30:00 49243 231.294 7.11376774745555 32.5135720213426 4040 12954
20 history 2018-11-08 19:15:00 49243 228.628 6.95098130014536 32.8914710208211 3914 12954
21 history 2018-11-08 19:00:00 49243 282.451 6.86958807649026 41.1161479924291 3782 12954
22 history 2018-11-08 18:45:00 49243 275.784 6.70680162918006 41.1200472666605 3638 12954
23 history 2018-11-08 18:30:00 49243 269.118 6.54401518186987 41.1242933460162 3485 12954
24 history 2018-11-08 18:15:00 49243 262.451 6.38122873455967 41.1285993524428 3327 12954
25 history 2018-11-08 18:00:00 49243 251.118 6.10449177413234 41.1365940509753 3166 12954
26 history 2018-11-08 17:45:00 49243 239.784 5.827754813705 41.1451764298843 3027 12954
27 history 2018-11-08 17:30:00 49243 233.118 5.66496836639481 41.1508034860143 2879 12954
28 history 2018-11-08 17:15:00 49243 223.118 5.50218191908461 40.5508220704414 2692 12954
29 history 2018-11-08 17:00:00 49243 208.451 5.06265851134709 41.1742169717338 2528 12954
30 history 2018-11-08 16:45:00 49243 193.784 4.78592155091975 40.490425498671 2334 12954
31 history 2018-11-08 16:30:00 49243 172.451 4.37895543264426 39.3817664172627 2143 12954
32 history 2018-11-08 16:15:00 49243 141.784 3.43479403824513 41.2787487171833 1912 12954
33 history 2018-11-08 16:00:00 49243 123.784 3.0766638541627 40.2331895414968 1654 12954
34 history 2018-11-08 15:45:00 49243 74.451 1.79065092041215 41.5776180333706 1399 12954
35 history 2018-11-08 15:30:00 49243 63.784 1.53019260471584 41.6836415255352 1172 12954
36 history 2018-11-08 15:15:00 49243 57.784 1.46507802579176 39.4409027934005 937 12954
37 history 2018-11-08 15:00:00 49243 51.118 1.22089835482647 41.869169368539 722 12954
38 history 2018-11-08 14:45:00 49243 35.784 0.846489526013018 42.2734114248801 526 12954
39 history 2018-11-08 14:30:00 49243 19.784 0.455802052468548 43.4048067419906 347 12954
40 history 2018-11-08 14:15:00 49243 19.784 0.455802052468548 43.4048067419906 197 12954

View file

@ -1,9 +1,17 @@
SELECT q.site, q.question, q.timestamp, q.hotness,
(LEAST(COUNT(a.*), 10) * (q.up_votes - q.down_votes) / 5.0 + SUM(a.up_votes - a.down_votes)) /
(GREATEST(DATE_PART('day', q.timestamp - qq.createddate) * 24 +
DATE_PART('hour', q.timestamp - qq.createddate) + 1, 6) ^ 1.4) AS calculated_hotness,
q.views, s.visits AS traffic
DATE_PART('hour', q.timestamp - qq.createddate) + 1, 6) ^ 1.4) *
CASE q.site WHEN 'workplace' THEN 0.55 WHEN 'softwareengineering' THEN 0.55 WHEN 'stackoverflow' THEN 0.2 ELSE 1 END
AS calculated_hotness,
q.hotness / (
(LEAST(COUNT(a.*), 10) * (q.up_votes - q.down_votes) / 5.0 + SUM(a.up_votes - a.down_votes)) /
(GREATEST(DATE_PART('day', q.timestamp - qq.createddate) * 24 +
DATE_PART('hour', q.timestamp - qq.createddate) + 1, 6) ^ 1.4) *
CASE q.site WHEN 'workplace' THEN 0.55 WHEN 'softwareengineering' THEN 0.55 WHEN 'stackoverflow' THEN 0.2 ELSE 1 END)
AS calculated_traffic_factor,
q.views, s.visits AS traffic
FROM snapshots AS q INNER JOIN questions AS qq
ON q.site = qq.site AND q.question = qq.id
INNER JOIN sites AS s ON q.site = s.name