On Thu, Aug 7, 2014 at 11:57 AM, Paul Jungwirth wrote:
> > Or another idea, add a column that is the path of the parent:
>
> I don't think this will work. The problem is you need the full path to
> keep the children with their parents, but you also need the score. If
> you make the path an array
> Or another idea, add a column that is the path of the parent:
I don't think this will work. The problem is you need the full path to
keep the children with their parents, but you also need the score. If
you make the path an array of (-votes, id) tuples (perhaps flattened
for simplicity), then yo
On Thu, Aug 7, 2014 at 8:12 AM, Vik Fearing wrote:
>
> Just export the order from your CTE.
>
> WITH RECURSIVE tree AS (
> SELECT dr.id,
>...,
>array[dr.id] as path,
>1 as depth,
>row_number() over (order by dr.num_votes desc) as sort_order
>
On 08/07/2014 01:22 PM, Gregory Taylor wrote:
> I got this recommendation from someone else, and think that it's
> probably the way to go. I've been playing with it unsuccessfully so far,
> though. Most certainly because I've got something weirded up. Here's
> what I have:
>
>
> WITH RECURSIV
Hello Martijn,
Thanks for the reply, my responses are inline below.
On Wed, Aug 6, 2014 at 5:38 PM, Martijn van Oosterhout
wrote:
> On Wed, Aug 06, 2014 at 05:28:09PM -0400, Gregory Taylor wrote:
> > We are working on a threaded comment system, and found this post by
> Disqus
> > to be super he
On Wed, Aug 06, 2014 at 05:28:09PM -0400, Gregory Taylor wrote:
> We are working on a threaded comment system, and found this post by Disqus
> to be super helpful:
>
> http://cramer.io/2010/05/30/scaling-threaded-comments-on-django-at-disqus/
>
> The CTE works wonderfully, and we're really happy
We are working on a threaded comment system, and found this post by Disqus
to be super helpful:
http://cramer.io/2010/05/30/scaling-threaded-comments-on-django-at-disqus/
The CTE works wonderfully, and we're really happy with the results. The
last obstacle is figuring out how to sort by a "votes"