Re: Slow index scan - Pgsql 9.2

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Patrick B <patrickbakerbr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Slow index scan - Pgsql 9.2
Date: 2017-01-10 02:34:36
Message-ID: CAKFQuwbgwwe2BQH2os6_WsPx+KaXF8k-jnZ+4jmHHECrdLqB2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 9, 2017 at 6:06 PM, Patrick B <patrickbakerbr(at)gmail(dot)com> wrote:

> *Explain Analyze:*
>
> CTE Scan on "query_p" "qp" (cost=0.01..1060.57 rows=1 width=8) (actual
> time=4065.244..4065.246 rows=1 loops=1)
>
> CTE query_p
>
> -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.002..0.003
> rows=1 loops=1)
>
> SubPlan 2
>
> -> Aggregate (cost=1060.53..1060.54 rows=1 width=0) (actual
> time=4065.229..4065.229 rows=1 loops=1)
>
> -> Index Scan using "clientid_customers" on "customers" "c"
> (cost=0.00..1059.01 rows=607 width=0) (actual time=9.105..4063.728
> rows=2513 loops=1)
>
> Index Cond: ("clientid" = "qp"."client_id")
>
> Filter: (NOT "deleted")
>
> Rows Removed by Filter: 1068
>
> Total runtime: 4075.753 ms
>
>
>
> Why a search for "client_id" is so slow??
>
>
​3,581​ individual pokes into the heap to confirm tuple visibility and
apply the deleted filter - that could indeed take a while.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Patrick B 2017-01-10 03:05:16 Re: Slow index scan - Pgsql 9.2
Previous Message Jan de Visser 2017-01-10 02:30:39 Re: Slow index scan - Pgsql 9.2