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

Alex Khatskevich avkhatskevich at tarantool.org
Fri Jun 1 15:16:45 MSK 2018


> Wait, where is rowid stored now? AFAIU it is still placed in the last field.
Yes. We still need the rowid to be the latest field, to make tuples unique.
However we cannot get the largest rowid by callind `index_max`. That was 
a point.
> 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.
> 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?

There is an option to maintain uint64 global counter, for all temp space 
rowids.
Rowids would not go sequentially anymore (gaps are possible), but we 
would preserve the main constraint: tuples would be unique. In that case 
we do not have to keep extra attribute in each
cursor.
> PS add patches mailing list to receivers so that our conversation is available for everyone.
Ouch. Done.




More information about the Tarantool-patches mailing list