← Back to team overview

maria-developers team mailing list archive

Re: implementing multi range read at the storage engine in MariaDB 5.5

 

Thanks for the pointers Igor.

On implementing this. Looking at MariaDB-5.5.28a, I see MyISAM,
InnoDB, and Aria all have the code below in their engine.

Is that all that is required? Do we need to copy and paste that code
into our engine? In fact, the only difference I see is that INnoDB
has:
  if (prebuilt->select_lock_type != LOCK_NONE)
    *flags |= HA_MRR_USE_DEFAULT_IMPL;
in multi_range_read_info_const.

Thanks
-Zardosht

The code:

int ha_maria::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
                                    uint n_ranges, uint mode,
                                    HANDLER_BUFFER *buf)
{
  return ds_mrr.dsmrr_init(this, seq, seq_init_param, n_ranges, mode, buf);
}

int ha_maria::multi_range_read_next(range_id_t *range_info)
{
  return ds_mrr.dsmrr_next(range_info);
}

ha_rows ha_maria::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
                                               void *seq_init_param,
                                               uint n_ranges, uint *bufsz,
                                               uint *flags, COST_VECT *cost)
{
  /*
    This call is here because there is no location where this->table would
    already be known.
    TODO: consider moving it into some per-query initialization call.
  */
  ds_mrr.init(this, table);
  return ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges, bufsz,
                                 flags, cost);
}

ha_rows ha_maria::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
                                       uint key_parts, uint *bufsz,
                                       uint *flags, COST_VECT *cost)
{
  ds_mrr.init(this, table);
  return ds_mrr.dsmrr_info(keyno, n_ranges, keys, key_parts, bufsz,
flags, cost);
}

int ha_maria::multi_range_read_explain_info(uint mrr_mode, char *str,
                                            size_t size)
{
  return ds_mrr.dsmrr_explain_info(mrr_mode, str, size);
}

On Fri, Feb 15, 2013 at 5:17 PM, Igor Babaev <igor@xxxxxxxxxxxx> wrote:
> On 02/15/2013 04:17 AM, Zardosht Kasheff wrote:
>> Hello all,
>>
>> Is there anything to implementing multi range read for storage
>> engines? Or is there a default implementation that is likely good
>> enough.
>>
>> Also, is there anything one can read to understand how the feature
>> works and its benefits?
>>
>> Thanks
>> -Zardosht
>
> Hi Zardosht,
>
> I googled "MySQL Multi Range Read" and got
> among other references:
>
> 1. https://kb.askmonty.org/en/multi-range-read-optimization/
>
> 2. http://dev.mysql.com/doc/refman/5.6/en/mrr-optimization.html
>
> The first article was written by Sergey Petrunia, the guy who wrote
> disk-sweep MRR.
> I find it the most comprehensive.
>
> The second article was written also by him but when he worked at Sun.
> Later this article was slightly changed by MySQL/Oracle people.
>
> Regards,
> Igor.
>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~maria-developers
>> Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~maria-developers
>> More help   : https://help.launchpad.net/ListHelp
>


Follow ups

References