"The changes feed is just a listing of documents ordered by their
current sequence numbers."

Succinctly put.

B.


On 23 August 2013 16:15, Jens Alfke <j...@couchbase.com> wrote:
>
> On Aug 23, 2013, at 1:01 AM, Jens Rantil <jens.ran...@gmail.com> wrote:
>
>> Just to be clear, does compaction influence the changes feed in any way?
>
> It may help to think of the changes feed this way:
>
> Every database has a last-sequence counter (similar to a SQL table’s 
> autoincrement counter.)
> Every document has a sequence number*.
> Whenever a document is updated (i.e. a revision is added) its sequence number 
> is changed to the next available sequence count.
> The changes feed is just a listing of documents ordered by their current 
> sequence numbers.
> (Under the hood, the database has a separate b-tree index that maps sequence 
> numbers to document IDs.)
>
> Thus the effect is that updating a document moves it to the end of the 
> changes feed, with a new sequence number.
>
> Compaction doesn’t have any effect on this at all; all it does is prune 
> intra-document revision data.
>
> —Other Jens ;)
>
> * This gets more complex with BigCouch/Cloudant, because it’s clustered. The 
> opaque sequence IDs it shows clients are actually aggregates of the sequence 
> numbers of all the nodes in the cluster.

Reply via email to