Hi!

So I was looking at the optimizer code a little bit tonight and came
across something I'm not sure about. Basically, I'm wondering why is
there a need for the POSITION struct in the optimizer?

>From what I can understand, an array of POSITION objects is used to
represent a query plan during optimization and once an optimal query
plan is chosen, this array of POSITION objects is copied into an array
of JoinTable objects (in get_best_combination()). Then during
execution time, the array of JoinTable objects represents the query
execution plan.

What I'm wondering is why not just use an array of JoinTable objects
during both optimization and execution? If you look at the POSITION
structure, it actually contains a pointer to a JoinTable object with
just a few additional members. In theory, could we just extend
JoinTable with the members from POSITION and remove the POSITION
structure?

Is there something I am missing here (very likely as I'm just starting
to look at the optimizer)? Is there some specific reason things are
designed like this?

-Padraig

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to