Re: execution of nested loop joins

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Esha Palta <esha(at)it(dot)iitb(dot)ac(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: execution of nested loop joins
Date: 2005-10-06 16:06:28
Message-ID: 20051006160621.GE10127@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 06, 2005 at 09:14:02PM +0530, Esha Palta wrote:
> ExecQual evaluates join conditions one at a time.It captures one
> condition and passes it to function ExecEvalExpr which is actually a
> macro that invokes another function evalfunc(a method of ExprState
> structure).

It's not a "method" of the ExprState structure in the way object
oriented people might think. It's a function pointer that is set to the
function PostgreSQL wants to use to evaluate the expression. It's of
type:

typedef Datum (*ExprStateEvalFunc) (ExprState *expression,
ExprContext *econtext,
bool *isNull,
ExprDoneCond *isDone);

It's more like a virtual method where whoever created the structure
decides which method to use. the actual function called will probably
be one of the ones in backend/executor/execQual.c. Object-orientation
for C.

> I am not getting implementation and use of this evalfunc function. Is
> this function used to evaluate the join condition or not. If yes, then
> how it does this.

It does, using one of the defined expression evaluation functions.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-10-06 16:54:30 Re: [PERFORM] A Better External Sort?
Previous Message Martijn van Oosterhout 2005-10-06 15:58:02 Re: PG function call