Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, Kostya Osipov <kostja@tarantool.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [tarantool-patches] Re: [PATCH v5 11/12] box: introduce offset slot cache in key_part
Date: Tue, 6 Nov 2018 15:15:22 +0300	[thread overview]
Message-ID: <5c111ccd-d2d6-1d67-187c-b6fb5be9cfa6@tarantool.org> (raw)
In-Reply-To: <20181101133222.GB30032@chai>

> I don't understand this comment. Could you please rephrase?
> I don't understand this statement either. Could you give an
> example?
> Did you consider storing it elsewhere, e.g. in some kind of 
> index search context?
Tuned tuple_field_by_part_raw routine with key_part's                        
offset_slot_cache. Introduced tuple_format epoch to test validity               
of this cache. The key_part caches last offset_slot source                      
format to make epoch comparison because same space may have                     
multiple format of same epoch that have different key_parts and                 
related offset_slots distribution.                                              
                                  
>> -	alter->new_space = space_new_xc(alter->space_def, &alter->key_list);
>> +	alter->new_space =
>> +		space_new_xc(alter->space_def, &alter->key_list,
>> +			     alter->old_space->format != NULL ?
>> +			     alter->old_space->format->epoch + 1 : 1);
> 
> Can't we make it simpler and simply increase epoch id every
> time we create a new space? This is only an optimization, 
> by leaking it into alter.cc you are making alter worry about
> stuff which should not be its concern.> Passing epoch id around explicitly is ugly.
The main problem we faced is that there are two formats in vinyl - regular
and disk format. Alter.cc does not know anything about the internal structure of
the vinyl space object, so he cannot update the disk epoch on his own.

> Why can't you do it in key_def_set_part?
> Lack of code reuse, abstraction leak.
Like this for now:
key_def_set_part(new_def, pos++, part->fieldno, part->type,
			   part->nullable_action, part->coll,
			   part->coll_id, part->sort_order, part->path,
			   part->path_len, part->offset_slot_cache,
			   part->format_cache);

> The source format to check that offset_slot_epoch is not stale.
> 
> Please avoid using the word "actuality".
"hit"

  reply	other threads:[~2018-11-06 12:15 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29  6:56 [PATCH v5 00/12] box: indexes by JSON path Kirill Shcherbatov
2018-10-29  6:56 ` [PATCH v5 01/12] box: refactor key_def_find routine Kirill Shcherbatov
2018-11-19 17:48   ` Vladimir Davydov
2018-10-29  6:56 ` [PATCH v5 10/12] box: tune tuple_field_raw_by_path for indexed data Kirill Shcherbatov
2018-10-29  6:56 ` [PATCH v5 11/12] box: introduce offset slot cache in key_part Kirill Shcherbatov
2018-11-01 13:32   ` [tarantool-patches] " Konstantin Osipov
2018-11-06 12:15     ` Kirill Shcherbatov [this message]
2018-10-29  6:56 ` [PATCH v5 12/12] box: specify indexes in user-friendly form Kirill Shcherbatov
2018-11-01 13:34   ` [tarantool-patches] " Konstantin Osipov
2018-11-01 14:18   ` Konstantin Osipov
2018-11-06 12:15     ` [tarantool-patches] " Kirill Shcherbatov
2018-10-29  6:56 ` [PATCH v5 02/12] box: introduce key_def_parts_are_sequential Kirill Shcherbatov
2018-11-01 14:23   ` [tarantool-patches] " Konstantin Osipov
2018-11-06 12:14     ` [tarantool-patches] " Kirill Shcherbatov
2018-11-19 17:48   ` Vladimir Davydov
2018-10-29  6:56 ` [PATCH v5 03/12] box: introduce tuple_field_go_to_path Kirill Shcherbatov
2018-11-19 17:48   ` Vladimir Davydov
2018-10-29  6:56 ` [PATCH v5 04/12] box: introduce tuple_format_add_key_part Kirill Shcherbatov
2018-11-01 14:38   ` [tarantool-patches] " Konstantin Osipov
2018-11-06 12:15     ` [tarantool-patches] " Kirill Shcherbatov
2018-11-19 17:50   ` Vladimir Davydov
2018-10-29  6:56 ` [PATCH v5 05/12] lib: implement JSON tree class for json library Kirill Shcherbatov
2018-11-01 15:08   ` [tarantool-patches] " Konstantin Osipov
2018-11-06 12:15     ` [tarantool-patches] " Kirill Shcherbatov
2018-11-19 17:53       ` Vladimir Davydov
2018-11-20 16:43   ` Vladimir Davydov
2018-11-21 10:37     ` [tarantool-patches] " Kirill Shcherbatov
2018-11-26 10:50     ` Kirill Shcherbatov
2018-10-29  6:56 ` [PATCH v5 06/12] box: manage format fields with JSON tree class Kirill Shcherbatov
2018-10-29  6:56 ` [PATCH v5 07/12] lib: introduce json_path_normalize routine Kirill Shcherbatov
2018-11-01 15:22   ` [tarantool-patches] " Konstantin Osipov
2018-11-01 15:27     ` [tarantool-patches] " Kirill Shcherbatov
2018-11-20 15:13       ` Vladimir Davydov
2018-11-26 10:50         ` Kirill Shcherbatov
2018-11-20 15:14   ` Vladimir Davydov
2018-10-29  6:56 ` [PATCH v5 08/12] box: introduce JSON indexes Kirill Shcherbatov
2018-11-20 16:52   ` Vladimir Davydov
2018-11-26 10:50     ` [tarantool-patches] " Kirill Shcherbatov
2018-10-29  6:56 ` [tarantool-patches] [PATCH v5 09/12] box: introduce has_json_paths flag in templates Kirill Shcherbatov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c111ccd-d2d6-1d67-187c-b6fb5be9cfa6@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] Re: [PATCH v5 11/12] box: introduce offset slot cache in key_part' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox