Re: Proposal: scan key push down to heap [WIP]

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: scan key push down to heap [WIP]
Date: 2016-10-13 00:35:15
Message-ID: CA+TgmoZz8u-_2p6H8cuGJtJnCyg9vG8QPShrU4mF-Ap8o-T9Hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 11, 2016 at 4:57 AM, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> This patch will extract the expression from qual and prepare the scan
> keys. Currently in POC version I have only supported "var OP const"
> type of qual, because these type of quals can be pushed down using
> existing framework.
>
> Purpose of this work is to first implement the basic functionality and
> analyze the results. If results are good then we can extend it for
> other type of expressions.
>
> However in future when we try to expand the support for complex
> expressions, then we need to be very careful while selecting
> pushable expression. It should not happen that we push something very
> complex, which may cause contention with other write operation (as
> HeapKeyTest is done under page lock).

I seriously doubt that this should EVER be supported for anything
other than "var op const", and even then only for very simple
operators. For example, texteq() is probably too complicated, because
it might de-TOAST, and that might involve doing a LOT of work while
holding the buffer content lock. But int4eq() would be OK.

Part of the trick if we want to make this work is going to be figuring
out how we'll identify which operators are safe.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-10-13 01:20:44 Typo in foreign.h
Previous Message Robert Haas 2016-10-13 00:27:36 Re: Is it time to kill support for very old servers?