Re: BUG #13908: Query returns too few rows

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Seth P <seth-p(at)outlook(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13908: Query returns too few rows
Date: 2016-02-03 05:01:04
Message-ID: CAKFQuwYsDPCi2CqRGmp+WZOGiJQa4Rga9LTRnM=DJfXoV16Cxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Feb 2, 2016 at 9:41 PM, Seth P <seth-p(at)outlook(dot)com> wrote:

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

​CREATE TABLE "rrr_temp" AS SELECT ​idx, barrid FROM "rrr" AND ...; --see
note below
CREATE TABLE "uuu_temp" AS SELECT barrid FROM "uuu" WHERE universe_hash =
#; -- 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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2016-02-03 09:38:03 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Previous Message Seth P 2016-02-03 04:41:47 Re: BUG #13908: Query returns too few rows