[tarantool-patches] Re: [PATCH 5/6] vinyl: run iterator: refactor seek method

Vladimir Davydov vdavydov.dev at gmail.com
Thu Mar 28 17:58:19 MSK 2019


On Thu, Mar 28, 2019 at 05:39:47PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [19/03/26 18:56]:
> > A few changes to make the function more straightforward:
> > 
> >  - Move bloom checking and LSN filtering out of 'do_seek' helper. Make
> >    the helper do just one simple task - lookup the first one in a series
> >    of statements matching the given search criteria.
> >  - Fold iterator type and key substitution in 'seek' method, similarly
> >    to how we did it for other iterators.
> >  - Cleanup EQ checks. Use the original iterator type and key where
> >    appropriate to remove extra checks in calling methods. Don't check EQ
> >    in 'seek' method in case it was checked by 'do_seek'.
> >  - Add some comments.
> 
> LGTM (same comment re passing EOF in return value applies).
> eq_found looks cumbersome, perhaps you could both kill bool
> eq_found and not pass eof in the out parameter of do_seek()?

eq_found is an optimization that allows us to save a tuple comparison.
Not that it really matters for the disk iterator, but still I'd rather
keep it.

As I said, I agree that retval conventions look ugly in the iterator
code. I didn't plan on cleaning it up now, because it doesn't really
stand in the way of tuple hints. I'll look into it a bit later.



More information about the Tarantool-patches mailing list