Re: Query performance problem - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query performance problem
Date
Msg-id 22878.1093019688@sss.pgh.pa.us
Whole thread Raw
In response to Query performance problem  ("Danilo Mota" <dmota@nexen.com.br>)
List pgsql-performance
"Danilo Mota" <dmota@nexen.com.br> writes:
> SELECT
>  rc.pkcliente
> FROM r_cliente AS rc
> INNER JOIN sav_cliente_lg AS sc ON sc.cpfcnpj = sc.cpfcnpj;

Surely you meant
  INNER JOIN sav_cliente_lg AS sc ON rc.cpfcnpj = sc.cpfcnpj;

I would also venture that your statistics are desperately out of date,
because if the planner's estimates are close to reality, even this
unconstrained-cross-product join shouldn't have taken that long.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Danilo Mota"
Date:
Subject: Query performance problem
Next
From: Bruno Wolff III
Date:
Subject: Re: Query performance problem