On Fri, Aug 23, 2019 at 10:17 AM <soumik.bhattacharjee@kpn.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