torodb / stampede

The ToroDB solution to provide better analytics on top of MongoDB and make it easier to migrate from MongoDB to SQL
https://www.torodb.com/stampede/
GNU Affero General Public License v3.0
1.77k stars 120 forks source link

Reset did sequential after drop a collection #148

Closed jerolba closed 7 years ago

jerolba commented 7 years ago

If you drop a collection and then insert a new document in this collection, the did of the new document is the next available did from the previous collection "instance", and is not reset to 0.

gortiz commented 7 years ago

DID is a private field used by ToroDB and the value should not be important to the user (as he usually only use it on joins). In fact, it is not guaranteed that this value will be an increasing integer and it may be changed on a near future. In addition to that, the current implementation has been designed to be append only, so it is not easy to implement this enhancement.

Therefore, we have decided to not implement it. If this behavior is required (for example, to create prettier slides, which I think it was the case), it can be simulated by restarting ToroDB after the collection is dropped.