Re: Very suspicious plan difference for select and corresponding delete queries PostgreSQL 9.6.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Very suspicious plan difference for select and corresponding delete queries PostgreSQL 9.6.2
Date: 2017-05-08 13:29:56
Message-ID: 4119.1494250196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com> writes:
> I can not see any possible/logical/realistic reason for the database to
> switch between INDEX ONLY SCAN and SEQ SCAN for EXIST part of query in this
> two cases.

If you'd done an EXPLAIN VERBOSE, you'd have noted that the scan was
returning ctid, which it could not get out of the index. This is
necessary for possible EPQ rechecks.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PAWAN SHARMA 2017-05-08 15:13:29 Migration Query
Previous Message Maxim Boguk 2017-05-08 12:52:09 Very suspicious plan difference for select and corresponding delete queries PostgreSQL 9.6.2