Thanks for the review Pavel.

On Tue, Jun 18, 2013 at 3:01 PM, Pavel Stehule <pavel.steh...@gmail.com>wrote:

> Hello
>
> related to
>
> https://commitfest.postgresql.org/action/patch_view?id=1130
>
> http://www.postgresql.org/message-id/cabwtf4v9rsjibwe+87pk83mmm7acdrg7sz08rq-4qyme8jv...@mail.gmail.com
>
>
> * motivation: remove recursive procession of AND/OR list (hangs with
> 10062 and more subexpressions)
>
> * patch is short, clean and respect postgresql source code requirements
> * patch was applied cleanly without warnings
> * all regression tests was passed
> * I successfully evaluated expression with 100000 subexpressions
> * there is no significant slowdown
>
> possible improvements
>
> a = (A_Expr*) list_nth(pending, 0);
>
> a = (A_Expr*) linitial(pending);
>
> not well comment
>
> should be -- "If the right branch is also an SAME condition, append it to
> the"
>
> +                       /*
> +                        * If the right branch is also an AND condition,
> append it to the
> +                        * pending list, to be processed later. This
> allows us to walk even
> +                        * bushy trees, not just left-deep trees.
> +                        */
> +                       if (IsA(a->rexpr, A_Expr) &&
> ((A_Expr*)a->rexpr)->kind == root_kind)
> +                       {
> +                               pending = lappend(pending, a->rexpr);
> +                       }
> +                       else
> +                       {
> +                               expr = transformExprRecurse(pstate,
> a->rexpr);
> +                               expr = coerce_to_boolean(pstate, expr,
> root_kind == AEXPR_AND ?
> "AND" : "OR");
> +                               exprs = lcons(expr, exprs);
> +                       }
>
> I don't see any other issues, so after fixing comments this patch is
> ready for commit
>
> Regards
>
> Pavel Stehule
>



-- 
Gurjeet Singh

http://gurjeet.singh.im/

EnterpriseDB Inc.

Reply via email to