TheProjecter / whazzup

Automatically exported from code.google.com/p/whazzup
0 stars 0 forks source link

Optimize AgeSubscription by doing it entirely in SQL #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It's worth a shot, because this operation is just way too slow right now.

Original issue reported on code.google.com by lar...@gmail.com on 26 Jul 2011 at 4:07

GoogleCodeExporter commented 9 years ago
Looks like we can do it: select id, pubdate, prob, (prob * 1000.0) / 
log(extract(epoch from age(pubdate))) from posts join rated_posts on id = post

The only question is what to do with posts which have negative ages. Need to 
check this a bit more thoroughly.

Original comment by lar...@gmail.com on 30 Jul 2011 at 10:13

GoogleCodeExporter commented 9 years ago
Implemented now.

Original comment by lar...@gmail.com on 30 Jul 2011 at 11:05