[HACKERS] Re: [PORTS] GEQO broken on 6-6-97?!? - Mailing list pgsql-hackers

From Vadim B. Mikheev
Subject [HACKERS] Re: [PORTS] GEQO broken on 6-6-97?!?
Date
Msg-id 41d099d5c125d31bf0ff33bfbf5671b6
Whole thread Raw
List pgsql-hackers
Darren King wrote:
>
> > Ok, it seems to be coming from
> >
> >            if(!path->p_ordering.ord.sortop) {
> >                         break;
> >                     }
> > in geqo_paths.c:geqo_rel_paths() & prune.c:prune_rel_paths()
> >
> > So as you can reproduce it, could you check with GEQO ON that
> > if (!path->p_ordering.ord.sortop) then compute_joinrel_size()
> > returns <= 0. If it's true then we can add check to geqo_eval.c
> > and allpaths.c:
> >
>
> I added a debug statement at the end of geqo_rel_paths() to print
> the rel->size and they were all positive, ranging in value from
> 73 to 2147483647 (MAX_INT).
        ^^^^^^^^^^
Thanks for help, Darren! I hope that cause found now:
compute_joinrel_size() shouldn't be called for non-JoinPath path!
In old opt-r we have:

        if (IsA_JoinPath(cheapest))
            {
                rel->size = compute_joinrel_size(cheapest);
            }
        else
            elog(WARN, "non JoinPath called");

- - so I changed geqo_rel_paths():

    cheapest = (JoinPath*)set_paths(rel, path);
    if ( IsA_JoinPath (cheapest) )
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        rel->size = compute_joinrel_size(cheapest);

    else - does nothing!

In this case compute_rel_size() in gimme_tree() will be called
(I added if ( new_rel->size <= 0 ) there yesterday).

CVS changed.

Vadim

------------------------------

pgsql-hackers by date:

Previous
From: "Vadim B. Mikheev"
Date:
Subject: Re: [HACKERS] FATAL 1:btree: items are out of order
Next
From: Emil Djagoredo
Date:
Subject: [none]