[tarantool-patches] Re: [PATCH] Fix ephemeral table next rowid generation

n.pettik korablev at tarantool.org
Tue Jun 19 17:55:10 MSK 2018


>> Now I am thinking about introducing secondary index for table with rowid on the last field.
>> Could you take a look at code and say whether this idea feasible or not?
> I am absolutely against it. It is overkill, to maintain the whole index just to implement a
> counter.

Well, I am of the opinion that it is not overkill, but proper solution.
Lets ask smb else for advice. Personally I strictly against your approach.

>> In this case, it would be easy to fetch max value from ‘last’ field and increment it.
>> Anyway even if this idea fails as well, lets come up with better solution.
> Why you do not like saving the counter in the cursor?

Since cursor is a kind of wrapper around iterator, i.e. it represents only interface of 
internal routine. On the other hand, rowid belongs to the ‘user’ space. 
Moreover, not all ephemeral spaces needs this rowid. Finally, if smith went wrong
and insertion in such space occurred not via this cursor, then rowid would be
Incorrect and no warning or error would appear. I would like to remind you that
we wanted to avoid using cursors for insertions and removals.

> There is an option to maintain uint64 global counter, for all temp space rowids.

Hm, once I heard that using global variables might lead you straight to the hell...





More information about the Tarantool-patches mailing list