Re: Design: Escort info from WHERE clause to executor? - Mailing list pgsql-hackers

From imad
Subject Re: Design: Escort info from WHERE clause to executor?
Date
Msg-id 1f30b80c0707241258l78992cd1o6844e8b71b455f0d@mail.gmail.com
Whole thread Raw
In response to Design: Escort info from WHERE clause to executor?  (peter.trautmeier@gmx.de)
Responses Re: Design: Escort info from WHERE clause to executor?
List pgsql-hackers
It looks like you need a customized version of AExpr Node.
In the backend parser, an AExpr Node is constructed against each given
WHERE expression. You can store the weight along with the expression.
Further, don't forget to upgrade the copy functions and equal
functions for AExpr if you want to take this weight value all the way
upto the executor.


--Imad
www.EnterpriseDB.com


On 7/24/07, peter.trautmeier@gmx.de <peter.trautmeier@gmx.de> wrote:
> Hi all,
>
> I want to pass additional weight info from the WHERE clause to the executor and I hope someone can help me with
this.
>
> I accept clauses like the following
>
> WHERE (foo='a'){1}
> WHERE (foo='a'){1} OR (bar='b'){2}
> WHERE ((foo='a'){1} OR (bar='b'){2})){42} OR (baz='c'){3}
>
> where the {} takes an integer as a weight that is attached to the preceding (partial) condition.
>
> In the executor, I need to access (1) the logical value of and (2) the weight associated with _each_ subexpression
thatwas entered. (Getting the weight from the parser to the executor is in itself a journey it seems, as some
expressiontypes are created anew - and not copied - and lose their annotated weight over and over again.)
 
>
> Furthermore I need the structure of OR to be preserved; the OR-of-OR structure from the last WHERE must be preserved
orat least be  reconstructible and must not be folded into a 3-valued OR (as canonicalize_qual and friends do.)
 
>
> To sum up, I am looking for a (decently efficient) scheme that is able to
>
> (1) pass arbitrary conditional expressions from WHERE to the executor in a structure preserving way.
> (2) annotate arbitrary expressions with weights that survive on its way from the parser to the executor.
> (3) access the logical value of particular subexpressions.
>
> I have some basic ideas how at least some of the requirements might be achieved. But as I am not totally satisfied
withmy ideas I hope you can provide me with some fresh input.
 
>
> ANY ideas are welcome.
>
> Regards,
> Peter
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                 http://www.postgresql.org/about/donate
>


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: strange buildfarm failure on lionfish
Next
From: "Marko Kreen"
Date:
Subject: Re: pgcrypto & strong ciphers limitation