Re: Performance issue with NestedLoop query

From: Qingqing Zhou <zhouqq(dot)postgres(at)gmail(dot)com>
To: Ram N <yramiyer(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance issue with NestedLoop query
Date: 2015-07-31 18:37:41
Message-ID: CAJjS0u3J44pJWptmd+Em2Ru8fe-qNMk0ysxwBXCeVka2Z3Rf3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Jul 31, 2015 at 10:55 AM, Ram N <yramiyer(at)gmail(dot)com> wrote:
>
> Thanks Qingqing for responding. That didn't help. It in fact increased the
> scan time. Looks like a lot of time is being spent on the NestedLoop Join
> than index lookups though I am not sure how to optimize the join.
>

Good news is that optimizer is right this time :-). The NLJ here does
almost nothing but schedule each outer row to probing the inner index.
So the index seek is the major cost.

Have you tried build a two column index on (b.start_date, b.end_date)?

Regards,
Qingqing

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alexandre de Arruda Paes 2015-08-05 01:41:13 Slow HashAggregate/cache access
Previous Message Matheus de Oliveira 2015-07-31 18:08:08 Re: Performance issue with NestedLoop query