Re: [HACKERS] OR clause - check code

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Vadim B(dot) Mikheev" <vadim(at)sable(dot)krasnoyarsk(dot)su>, PostgreSQL-development <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] OR clause - check code
Date: 1998-08-01 11:51:54
Message-ID: 35C30159.673D85FF@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
>
> Vadim, would you please review this code, and let me know if it is
> correct. I am unsure about the calls to ExecStoreTuple(), ExecQual()
> (is proper context used?), and placement of ReleaseBuffer(). Do I need
^^^^^^^^^^^^^^^^^^^^^^
Yes.
execScan.c:ExecScan() sets econtext->ecxt_scantuple = slot <--
returned by Seq/Index scan -- before check Scan qual and
so econtext->ecxt_scantuple already points to the slot where
you store new tuple. It seems that no one change this pointer...

But did you try to use multi-index scan in inner plan of
Nestloop? It seems that you should add this to ExecIndexReScan():

if (exprCtxt != NULL)
node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple =
exprCtxt->ecxt_outertuple;

Also, ExecIndexReScan() evaluates run-time keys for _current_
index scan only - this must be changed and indexstate->iss_IndexPtr
must be setted to 0.

> to free the tuple buffer if I decide it doesn't meet my ExecQual test?

Yes, you have to free buffer.

Vadim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1998-08-01 12:12:18 Re: [HACKERS] OR with multi-key indexes
Previous Message Bruce Momjian 1998-08-01 11:33:20 OR with multi-key indexes