Re: BUG #13908: Query returns too few rows - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #13908: Query returns too few rows
Date
Msg-id CAKFQuwYsDPCi2CqRGmp+WZOGiJQa4Rga9LTRnM=DJfXoV16Cxw@mail.gmail.com
Whole thread Raw
In response to BUG #13908: Query returns too few rows  (seth-p@outlook.com)
List pgsql-bugs
On Tue, Feb 2, 2016 at 9:41 PM, Seth P <seth-p@outlook.com> wrote:

> "barrid" is "character varying(8) NOT NULL", and some examples are
> 'CANCEJ1' and 'USA06Z1'.
>
Consider...

=E2=80=8BCREATE TABLE "rrr_temp" AS SELECT =E2=80=8Bidx, barrid FROM "rrr" =
AND ...; --see
note below
CREATE TABLE "uuu_temp" AS SELECT barrid FROM "uuu" WHERE universe_hash =3D
#; -- should get 7,993 record

modify the WHERE clause for "rrr_temp" so you copy in the same records into
rrr_temp as matched in the full query: # 1,275,138 from the explain analyze
for A (and A-D too)

Now run simple join sub-queries inside your count(*)

If it repeats you should be able to supply the temporary table data as
unless barrid values are somehow super-secret.  You do not have to send the
data to the public list either - you can send it privately to someone (not
me, Tom should be good but confirm before sending).

Hope that helps.

David J.

pgsql-bugs by date:

Previous
From: Seth P
Date:
Subject: Re: BUG #13908: Query returns too few rows
Next
From: wangzilong@yeezon.com
Date:
Subject: BUG #13910: synchronous replication not sync data occasionally