Re: Help with optimizing a query over hierarchical data

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Damon Snyder <damon(at)huddler-inc(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Help with optimizing a query over hierarchical data
Date: 2014-03-02 01:02:24
Message-ID: CAGTBQpbXePRsCqsGK_x1MQ9bej-jCNnpPuV52aPMSbDZUNoQFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Feb 28, 2014 at 5:01 PM, Damon Snyder <damon(at)huddler-inc(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message acanada 2014-03-03 10:17:44 Re: Query taking long time
Previous Message Damon Snyder 2014-02-28 20:01:52 Help with optimizing a query over hierarchical data