Re: BUG #13908: Query returns too few rows

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

On Tue, Feb 2, 2016 at 3:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> seth-p(at)outlook(dot)com writes:
> > Query (A-D) (with DISTINCT) should not return more rows than query (A)
> (the
> > identical query without DISTINCT), so clearly something is wrong there.
>
> That does seem fishy, but unless you can provide a self-contained test
> case, it's unlikely that we are going to be able to magically locate
> the problem. I'd suggest seeing if you can reproduce the issue with
> some obfuscated or randomly-generated data.
>

​While Tom is correct I'd like to make a couple of points...

It apparently isn't the DISTINCT query that is increasing the count of rows
but rather than the non-DISTINCT version fails to return/count as many as
are actually present - but only when dealing with the entire range...

​Lacking a reproducible test case you really need to at least supply an
EXPLAIN ANALYZE so that actual row counts at each node can be observed.

The note about the apparent extra HASH first made me think that there must
be some kind of hash collision involved in the data - apparently one that
occurs between data points in B and C but not within B or within C...but I
fear this might be a red herring. But if it is a collision then the odds
of random data exhibiting the problem are quite slim...

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Seth P 2016-02-03 02:05:29 Re: BUG #13908: Query returns too few rows
Previous Message Tom Lane 2016-02-02 22:55:28 Re: BUG #13906: improper hstore_to_json_loose functioning