[Maria-developers] ha_innobase::info_low() n_rows hack

2017-09-11 Thread Aleksey Midenkov
In ha_innobase::info_low() there is following dirty hack: /* The MySQL optimizer seems to assume in a left join that n_rows is an accurate estimate if it is zero. Of course, it is not, since we do not have any locks on the rows yet at this phase. Since SHOW TABLE STATUS seems to call this function

Re: [Maria-developers] ha_innobase::info_low() n_rows hack

2017-09-11 Thread Sergei Golubchik
Hi, Aleksey! On Sep 11, Aleksey Midenkov wrote: > In ha_innobase::info_low() there is following dirty hack: > > if (n_rows == 0 && !(flag & HA_STATUS_TIME)) { > n_rows++; > } > > It is very old (from 5.0 or earlier) and bug-prone. Because in > ha_innobase::open(): > > info(HA_STATUS_NO_

Re: [Maria-developers] ha_innobase::info_low() n_rows hack

2017-09-11 Thread Aleksey Midenkov
Hello! On Mon, Sep 11, 2017 at 4:37 PM, Sergei Golubchik wrote: > Hi, Aleksey! > > On Sep 11, Aleksey Midenkov wrote: >> In ha_innobase::info_low() there is following dirty hack: >> >> if (n_rows == 0 && !(flag & HA_STATUS_TIME)) { >> n_rows++; >> } >> >> It is very old (from 5.0 or earli

Re: [Maria-developers] ha_innobase::info_low() n_rows hack

2017-09-11 Thread Sergei Golubchik
Hi, Aleksey! On Sep 11, Aleksey Midenkov wrote: > On Mon, Sep 11, 2017 at 4:37 PM, Sergei Golubchik wrote: > > Hi, Aleksey! > > > > On Sep 11, Aleksey Midenkov wrote: > >> In ha_innobase::info_low() there is following dirty hack: > >> > >> if (n_rows == 0 && !(flag & HA_STATUS_TIME)) { > >>