Re: Optimization for index-only scans with filter conditions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mateusz Stefek <mateusz(dot)stefek(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimization for index-only scans with filter conditions
Date: 2016-12-11 18:20:18
Message-ID: 12207.1481480418@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mateusz Stefek <mateusz(dot)stefek(at)gmail(dot)com> writes:
> Attached is a patch, which changes the order of the checks. I.e. the
> visibility of the row is confirmed only after the qual condition is
> evaluated to true.

This cannot be accepted, because it's unsafe to try to apply user
code to a dead tuple. The tuple might reference toast data that's
not there anymore, or in the worst case it might not even match
the table rowtype anymore.

Even without that problem, I would think that whether it is a win or
not would be mighty workload-dependent.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-12-11 18:52:57 Re: building HEAD on macos fails with #error no source of random numbers configured
Previous Message Tom Lane 2016-12-11 18:12:24 Re: [sqlsmith] Crash in tsquery_rewrite/QTNBinary