maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #04177
Re: Proposal to split @@optimizer_switch
On Fri, Jun 10, 2011 at 12:50:34PM +0200, Sergei Golubchik wrote:
> Hi, Sergey!
>
> On Jun 10, Sergey Petrunya wrote:
> > Hello,
> >
> > Please find below descriptions of problems with current @@optimizer_switch
> > variable, as well as a proposal on how to fix it.
> >
> > <contents>
> > Problems with @@optimizer_switch
> > Proposed solution
> > Details about hooking this into parser
> > Alternate approach1: grouping
> > </contents>
> >
> > Problems with @@optimizer_switch
> > --------------------------------
> >
> > @@optimizer_switch variable use has outgrown its syntax. There are
> > too many settings to fit on the single line:
> >
> > Proposed solution
> > -----------------
> >
> > Break optimizer_switch into multiple variables, with names having the dots
> > in them. That is, current @@optimizer_switch flags will change into this set
> > of variables:
> >
> > optimizer.index_merge=on
> > optimizer.index_merge.union=on
>
> Assorted thoughts:
>
> * I'd suggest to do any changes not in 5.3 but in 5.5, in the new
> sys_vars code
>
> * hierarchical structure of settings is good
>
> * but it has to be done the drizzle way, I mean, all options converted
> at once (you cannot switch the country from right-hand traffic to
> left-hand, by switching only few roads or few cars first :)
I don't see how this analogy works. I understand that a switched car will
collide with non-switched car. If we switch only optimizer variables, what will
that collide with?
> * on the other hand, we don't want to break the backward compatibility,
> so there's a contradiction
>
> * and we want to be compatible with MySQL, right?
Yes.
> * one possibile solution: introduce dots and hierarchy, but for the
> purpose of name matching, compare them as underscores. have an option
> to choouse between printing dots or underscores in show variables.
(replied in another email)
> * another solution, create hierarchies implicitly, splitting on
> underscores. Rename variables that don't fit into the correct
> hierarchy, keep old names as obsolete aliases, remove them later.
If there was a direct mapping from underscores to dots, there would have been
no point in the dot notation.
There is no point in changing @@time_zone to @@time.zone or
@@table_definition_cache to table.definition.cache.
> Allow user to write SET optimizer_semijoin_*= default
> Frankly speaking, I'd prefer a dot as a separator, not an underscore.
>
> * you forgot saving and restoring the value of a group. Now one can save
> @@optimizer_switch in a variable and restore it later. How to do it
> with hierarchies?
We've rejected the SET optimizer.xxx.yyy.*=... syntax in favor of SET
optimizer.prefix=...
> * named keycaches once again will be a problem, the syntax is so out of
> line, it never fits anywhere
I think that disallowing a few names for named key caches ('optimizer',
'aria','innodb') is not a big problem?
BR
Sergey
--
Sergey Petrunia, Software Developer
Monty Program AB, http://askmonty.org
Blog: http://s.petrunia.net/blog
Follow ups
References