Re: Help with optimizing a query over hierarchical data - Mailing list pgsql-performance

From Claudio Freire
Subject Re: Help with optimizing a query over hierarchical data
Date
Msg-id CAGTBQpbXePRsCqsGK_x1MQ9bej-jCNnpPuV52aPMSbDZUNoQFg@mail.gmail.com
Whole thread Raw
In response to Help with optimizing a query over hierarchical data  (Damon Snyder <damon@huddler-inc.com>)
Responses Re: Help with optimizing a query over hierarchical data
List pgsql-performance
On Fri, Feb 28, 2014 at 5:01 PM, Damon Snyder <damon@huddler-inc.com> wrote:
> The primary query that I'm trying to optimize executes in about 1600ms on my
> laptop and about 800ms on production-like hardware (more for the score
> version). My target is to get the data fetch down below 100ms if possible.

Could you post some explain analyze of those particular queries?

> If you have any suggestions it would be greatly appreciated. Am I missing
> something obvious? Is there a logically equivalent alternative that would be
> more efficient?

I'd suggest de-normalizing a bit. For instance, why don't you put the
score right into the object? I'm sure the indirection is hurting.


pgsql-performance by date:

Previous
From: Damon Snyder
Date:
Subject: Help with optimizing a query over hierarchical data
Next
From: "acanada"
Date:
Subject: Re: Query taking long time