← Back to team overview

maria-developers team mailing list archive

Re: Proposal to split @@optimizer_switch

 

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 :)

* 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?

* 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.

* 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.
  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?

* named keycaches once again will be a problem, the syntax is so out of
  line, it never fits anywhere

Regards,
Sergei



Follow ups

References