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 09AAB9872 for ; Mon, 21 May 2012 04:04:52 +0000 (UTC) Received: (qmail 74925 invoked by uid 500); 21 May 2012 04:04:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 74841 invoked by uid 500); 21 May 2012 04:04:49 -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 74831 invoked by uid 99); 21 May 2012 04:04:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 04:04:49 +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 paul.joseph.davis@gmail.com designates 209.85.161.180 as permitted sender) Received: from [209.85.161.180] (HELO mail-gg0-f180.google.com) (209.85.161.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 04:04:43 +0000 Received: by ggnf1 with SMTP id f1so4924872ggn.11 for ; Sun, 20 May 2012 21:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=fECSPuXDTo90Vkkmea5ss2fNu8fqJlZxnipnX87QjoY=; b=hSiJOGVZuesZVdF6Q/54vMVwSfU8o0vMBn2sJrNv0WgdQCO8rtz6Xi7YYlHxuUuT+X AlsB4nC2eAGNOMC4T4n9p/XufTRsKqcvvLInHgj11hBPgxtKPiqU/Zrj87VrLKsxWwix H18NwmLoKt7cLOEqI/kk85fo1olg8xSdzb8WZ9OuCtO7pHmsWt0cWmz+H/cxRE3kzFBo JFt+HqvacKqvsYyqQiwyR/jkst7/Mtg3X0oJyEccKrnGgYFeN9i9oFIDVjhyWeDK9GFp yXEwPxG1R5eiIfOv2f9Ufiny6bGwbqT+yOzhIOUIG6YEU7yh/2fou48MiqFqoyP0wzb5 Virw== Received: by 10.50.207.36 with SMTP id lt4mr5805178igc.5.1337573062881; Sun, 20 May 2012 21:04:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.231.130 with HTTP; Sun, 20 May 2012 21:03:42 -0700 (PDT) In-Reply-To: <8D5C952F-D0AA-4DCF-AD61-275203F79241@sri.com> References: <8D5C952F-D0AA-4DCF-AD61-275203F79241@sri.com> From: Paul Davis Date: Sun, 20 May 2012 23:03:42 -0500 Message-ID: Subject: Re: purging documents? To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Yeah, likely the best way to undo this would be to use filtered replication to a local db and then rename the .couch files and reboot to get it swapped over. On Fri, May 18, 2012 at 1:02 PM, Jim Klo wrote: > Not sure how many docs you have, but can you filter replicate the good do= cs > into a new db? > > > Jim Klo > Senior Software Engineer > Center for Software Engineering > SRI International > > On May 18, 2012, at 10:39 AM, Tim Tisdall wrote: > > After further reading it seems like I could use _purge ... =A0However, I > still need to query the DB to fetch all the revisions. > > On Fri, May 18, 2012 at 12:12 PM, Tim Tisdall wrote: > > I accidentally created several million documents in my DB which I'd like > > to undo. =A0^_^ =A0I know I can query each document to get the revision a= nd > > then issue a DELETE, but that seems like a lot of additional work. =A0Als= o, > > the wiki says "Deleted documents remain in the database forever, even aft= er > > compaction, to allow eventual consistency when replicating." and that's a > > lot of dead space. =A0Is there a way that I can purge all of those docume= nts > > given that I have the _ids that they were saved under? =A0I essentially w= ould > > like to return the DB to a state before I inserted all of those documents= . > > > I'm also going to be inserting updated documents to the DB with those sam= e > > _ids, so another alternative is to post updates to each (but that would > > also require getting the revision ids) and then clearing out old revision= s. > > However, this would require fetching several million revision ids and the= n > > figuring out how to force the DB to clear out all old revisions. > > > -Tim > > >