pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: david.raymond@tomtom.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15922: Simple select with multiple exists filters returns duplicates from a primary key field
Date: Tue, 23 Jul 2019 13:52:04 -0400
Message-ID: <7671.1563904324@sss.pgh.pa.us> (raw)
In-Reply-To: <15922-969d62a9b4d95ee1@postgresql.org>
References: <15922-969d62a9b4d95ee1@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> I have a case where I'm doing a simple select from a table but I'm getting
> returned duplicates from its primary key field when I have two different
> exists statements in the where clause.

Hm.  Seems like pretty clearly a planner bug --- the second plan seems
to be missing the de-duplication step that's done by the HashAggregate
in the first plan.  But I don't want to try to reproduce it with just
the info in this report.  Can you generate dummy or sanitized data to
make a self-contained test case that reproduces the problem?

It'd be useful to know also if the problem goes away if you disable
parallel query (SET max_parallel_workers_per_gather = 0, for instance).

Also, does the issue go away if you drop either or both of the foreign
key constraints?

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <7671.1563904324@sss.pgh.pa.us>
Permalink:  ../7671.1563904324@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7671.1563904324@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.raymond@tomtom.com
  Subject: Re: BUG #15922: Simple select with multiple exists filters returns duplicates from a primary key field
  In-Reply-To: <7671.1563904324@sss.pgh.pa.us>
  References: <15922-969d62a9b4d95ee1@postgresql.org> <7671.1563904324@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox