pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: a.schnabl@synedra.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16993: Query Planner does not use index for EXISTS-query on a large table with all equal foreign key values
Date: Wed, 05 May 2021 10:31:10 -0400
Message-ID: <4016383.1620225070@sss.pgh.pa.us> (raw)
In-Reply-To: <16993-1298e8dc9c41ab97@postgresql.org>
References: <16993-1298e8dc9c41ab97@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> ... EXPLAIN ANALYZE shows the following query plan:

> Merge Join  (cost=179053.41..179054.24 rows=1 width=8) (actual
> time=2140.820..2140.822 rows=1 loops=1)

> [ but with ]  SET enable_seqscan = false:

> Nested Loop Semi Join  (cost=0.57..12.85 rows=1 width=8) (actual
> time=0.877..0.920 rows=1 loops=1)

Yeah, that seems *extremely* broken.  The planner correctly estimates
the second plan as much cheaper, so why did it fail to choose that one
without help?  Will look into this.

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <4016383.1620225070@sss.pgh.pa.us>
Permalink:  ../4016383.1620225070@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4016383.1620225070@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, a.schnabl@synedra.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16993: Query Planner does not use index for EXISTS-query on a large table with all equal foreign key values
  In-Reply-To: <4016383.1620225070@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