Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4C35C10641 for ; Fri, 23 Aug 2013 16:09:00 +0000 (UTC) Received: (qmail 9238 invoked by uid 500); 23 Aug 2013 16:08:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 8926 invoked by uid 500); 23 Aug 2013 16:08:57 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 8915 invoked by uid 99); 23 Aug 2013 16:08:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 16:08:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of theboss@purplebulldog.com designates 209.85.160.42 as permitted sender) Received: from [209.85.160.42] (HELO mail-pb0-f42.google.com) (209.85.160.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 16:08:51 +0000 Received: by mail-pb0-f42.google.com with SMTP id un15so847836pbc.29 for ; Fri, 23 Aug 2013 09:08:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=4Ck64R1V5QuM/pdN9NhD9xeYcqWd9WplR0tPkNzsjLE=; b=G5t2gnBVZAqEMLSwXNfX3ku6jD25jww0mNHVkZAS6Ke/Sq5XaK2MSWbbsvNLLm49/S cvtvmSHFHEXq3sfi/PCOs2kc6ZODF9Alc6pxa7pH9lrB9tRSu722y69SccDsA4jOq9/O k2qzHzppYB0ahhpGzgiG6/Aq3IH0pvHU7esmeEIeLUK8rRN4pFgGw9u6OPatOH5nI9IZ D9uaIRtFuDQgSzrM/rKQJBNKR5ByqxByIxXPk8Hlxgxdvwrgc3639nNFTVS0e7fPu2H2 ZG4mVO78Xd49Ms5EtUEy9gx/rMPq5n5So6aPLFFKu+tBLMT6Q7dPWHpjQTMMz7Wd/pbm swdA== X-Gm-Message-State: ALoCoQl1da8KHlxAh1f7kQ/8hzw0rbOlgnxt7f+4MHcxloQxRupUzUFyjLCPTYSGBoT/va08upiN X-Received: by 10.68.253.161 with SMTP id ab1mr498221pbd.76.1377274110846; Fri, 23 Aug 2013 09:08:30 -0700 (PDT) Received: from [10.129.122.73] (mobile-198-228-212-152.mycingular.net. [198.228.212.152]) by mx.google.com with ESMTPSA id w6sm594089pbt.32.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 09:08:30 -0700 (PDT) References: <1B06C1C0-F8B9-4ADE-AF66-CB209D602CF5@couchbase.com> Mime-Version: 1.0 (1.0) In-Reply-To: <1B06C1C0-F8B9-4ADE-AF66-CB209D602CF5@couchbase.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: Cc: "user@couchdb.apache.org" X-Mailer: iPhone Mail (10B350) From: James Hayton Subject: Re: Changes API - purged? Date: Fri, 23 Aug 2013 09:08:28 -0700 To: "user@couchdb.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org So something interesting here to me is that each document had a seq no... Is= there any way to figure out what that is from the id/rev? =20 On Aug 23, 2013, at 8:15 AM, Jens Alfke wrote: >=20 > On Aug 23, 2013, at 1:01 AM, Jens Rantil wrote: >=20 >> Just to be clear, does compaction influence the changes feed in any way? >=20 > It may help to think of the changes feed this way: >=20 > Every database has a last-sequence counter (similar to a SQL table=E2=80=99= s autoincrement counter.) > Every document has a sequence number*. > Whenever a document is updated (i.e. a revision is added) its sequence num= ber is changed to the next available sequence count. > The changes feed is just a listing of documents ordered by their current s= equence numbers. > (Under the hood, the database has a separate b-tree index that maps sequen= ce numbers to document IDs.) >=20 > Thus the effect is that updating a document moves it to the end of the cha= nges feed, with a new sequence number. >=20 > Compaction doesn=E2=80=99t have any effect on this at all; all it does is p= rune intra-document revision data. >=20 > =E2=80=94Other Jens ;) >=20 > * This gets more complex with BigCouch/Cloudant, because it=E2=80=99s clus= tered. The opaque sequence IDs it shows clients are actually aggregates of t= he sequence numbers of all the nodes in the cluster.