From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 4 Apr 2019 12:09:22 +0300 From: Vladimir Davydov Subject: Re: [PATCH 01/13] vinyl: store tuple comparison hints in memory tree Message-ID: <20190404090922.vbg5nqfk75czb77n@esperanza> References: <20190404085327.GB13709@chai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190404085327.GB13709@chai> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Thu, Apr 04, 2019 at 11:53:27AM +0300, Konstantin Osipov wrote: > * Vladimir Davydov [19/04/02 20:35]: > > This patch incorporates tuple comparison hints into vy_mem_tree, > > similarly to how it was done in case of memtx_tree. > > > > Apart from speeding up lookups, this is also needed for multikey index > > support, because multikey indexes will reuse hints to store offsets of > > indexed array entries. > > The patch is OK to push. See one comment below. > > > while (!vy_mem_tree_iterator_is_invalid(&itr)) { > > + struct vy_mem_tree_elem replaced = vy_mem_tree_elem_invalid(); > > I would use eof or null rather than invalid, e.g. > vy_mem_tree_iterator_is_eof() > vy_mem_tree_eof > > or: > > vy_mem_tree_iterator_is_eof() > vy_mem_tree_null I called it 'invalid' to be consistent with the BPS tree API, see bps_tree_invalid_iterator. Also, it's used not only for EOF - we set the iterator position to this value before iteration is started. That said, I'd rather leave the name as is.