Re: Postgres DB Slowness

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: soumik(dot)bhattacharjee(at)kpn(dot)com
Cc: eddy(dot)adarsh(at)gmail(dot)com, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres DB Slowness
Date: 2019-08-23 11:08:24
Message-ID: CAC+AXB2=EA-iCdURZDxALoJUHsRi+dn0a=J6L26m=wPCSqnY5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Aug 23, 2019 at 10:17 AM <soumik(dot)bhattacharjee(at)kpn(dot)com> wrote:
>
> Query
> ===========
> SELECT
> i.*
> FROM
> npcurren.num_cps_instelling i,
> npcurren.num_aangesloten_nr n
> WHERE
> n.fk_exploit_nop_int_oper_id = 'PTT'
> AND i.telefoonnummer != n.anr_nummer_hoog
> AND i.telefoonnummer != n.anr_nummer_laag;
>
> Explain Plan
> ======================
> "Nested Loop (cost=2068.47..1769226624.33 rows=101090505159 width=73)"
>

This query looks wrong, resulting in a cartesian join.

As other people have pointed out, the execution times do not seem
reasonable, could you change the 'SELECT *' into a 'SELECT count(1)'
for the comparison?

Regards,

Juan José Santamaría Flecha

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message legrand legrand 2019-08-23 11:35:49 Re: Postgres DB Slowness
Previous Message soumik.bhattacharjee 2019-08-23 08:16:20 RE: Postgres DB Slowness