From user-return-20845-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri May 18 18:03:33 2012 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 B6BC496A6 for ; Fri, 18 May 2012 18:03:33 +0000 (UTC) Received: (qmail 72627 invoked by uid 500); 18 May 2012 18:03:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 72572 invoked by uid 500); 18 May 2012 18:03:32 -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 72562 invoked by uid 99); 18 May 2012 18:03:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 18:03:32 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [128.18.84.132] (HELO brightmail-internal3.sri.com) (128.18.84.132) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 18:03:21 +0000 X-AuditID: 80125484-b7f426d000006382-97-4fb68ed2f048 Received: from exchange-hub03.SRI.COM (exchange-hub03.SRI.COM [128.18.23.155]) (using TLS with cipher AES128-SHA (AES128-SHA/128 bits)) (Client did not present a certificate) by brightmail-internal3.sri.com (SRI Internal SMTP Gateway) with SMTP id 75.1C.25474.2DE86BF4; Fri, 18 May 2012 11:02:58 -0700 (PDT) Received: from EXCHANGE-DB08.SRI.COM ([fe80::a11e:7c21:6886:9a20]) by exchange-hub03.SRI.COM ([fe80::8c0e:cf22:fef8:cb20%15]) with mapi id 14.02.0283.003; Fri, 18 May 2012 11:02:39 -0700 From: Jim Klo To: "" Subject: Re: purging documents? Thread-Topic: purging documents? Thread-Index: AQHNNRESjp49IuMebEK1yf6djSi+lJbQRaAAgAAGf4A= Date: Fri, 18 May 2012 18:02:39 +0000 Message-ID: <8D5C952F-D0AA-4DCF-AD61-275203F79241@sri.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.12.16.210] Content-Type: multipart/signed; boundary="Apple-Mail-159-427208600"; protocol="application/pkcs7-signature"; micalg=sha1 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsXSICQ+W/dS3zZ/g7mvTCw69+xlc2D02Pjh OGMAYxSXTUpqTmZZapG+XQJXxu5JpxkLeqIqju1/ydLAeCOwi5GTQ0LAROLy7E/MELaYxIV7 69m6GLk4hAR2MklcmHMUytnHKLG6/wtYFZuAvMTh7Q/AbBEBS4lbCz6ygNjCQPHFH24xQsQV JHZd+cIKYVtJXD62DSjOwcEioCrRuTkZJMwLFJ63YgEbiC0kMJ1RYtfxHBCbUyBQ4ure92Dj GYEO+n5qDROIzSwgLnHryXwmiENFJB5ePM0GYYtKvHz8jxVkvISAosTlU8YQ5VUSBxYtZoNY JShxcuYTlgmMIrOQTJqFpGwWkjKIuIfEvkfHoWq0JZYtfM08C2gDs4COxOSFjKjCEPbH80eg yk0lXh/9CFVjLTHj10E2CFtRYkr3Q/YFjNyrGGWSijLTM0pyEzNzdGGRaaxXXJSpl5yfu4kR HK0hLTsYV+wyPMQowMGoxMMbMXmrvxBrYllxZe4hRgkOZiUR3gK1bf5CvCmJlVWpRfnxRaU5 qcWHGKU5WJTEecOM+f2FBNITS1KzU1MLUotgskwcnFINjCpXzXYotfhMkc7Lks8SaHjN8jSD t/5M4iqZzybfFOv/sHBHL1z90S269t9vj0hlDi2ekyf7PDrEtDVWPzif+VvvtdqFjoJsh1tp 51Jy843vCUTFMCVPXvskyVBjX4Z2eKO3+IZlAZmP9zp/nJoq0VxQmSD30kFK9cZTt1gejXsz 1hzr7rFWYinOSDTUYi4qTgQA5Ibx4dICAAA= --Apple-Mail-159-427208600 Content-Type: multipart/alternative; boundary=Apple-Mail-158-427208558 --Apple-Mail-158-427208558 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Not sure how many docs you have, but can you filter replicate the good = docs 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 ... However, I > still need to query the DB to fetch all the revisions. >=20 > On Fri, May 18, 2012 at 12:12 PM, Tim Tisdall = wrote: >=20 >> I accidentally created several million documents in my DB which I'd = like >> to undo. ^_^ I know I can query each document to get the revision = and >> then issue a DELETE, but that seems like a lot of additional work. = Also, >> the wiki says "Deleted documents remain in the database forever, even = after >> compaction, to allow eventual consistency when replicating." and = that's a >> lot of dead space. Is there a way that I can purge all of those = documents >> given that I have the _ids that they were saved under? I essentially = would >> like to return the DB to a state before I inserted all of those = documents. >>=20 >> I'm also going to be inserting updated documents to the DB with those = same >> _ids, so another alternative is to post updates to each (but that = would >> also require getting the revision ids) and then clearing out old = revisions. >> However, this would require fetching several million revision ids and = then >> figuring out how to force the DB to clear out all old revisions. >>=20 >> -Tim >>=20 --Apple-Mail-158-427208558 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Not = sure how many docs you have, but can you filter replicate the good docs = into a new db?


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 ...  However, = I
still need to query the DB to fetch all the revisions.

On = Fri, May 18, 2012 at 12:12 PM, Tim Tisdall <tisdall@gmail.com> = wrote:

I accidentally created several = million documents in my DB which I'd like
to undo.  ^_^  I know I can query each document = to get the revision and
then = issue a DELETE, but that seems like a lot of additional work. =  Also,
the wiki says = "Deleted documents remain in the database forever, even = after
compaction, to allow = eventual consistency when replicating." and that's = a
lot of dead space.  Is = there a way that I can purge all of those = documents
given that I have = the _ids that they were saved under?  I essentially = would
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 = same
_ids, so another = alternative is to post updates to each (but that = would
also require getting the = revision ids) and then clearing out old = revisions.
However, this = would require fetching several million revision ids and = then
figuring out how to force = the DB to clear out all old revisions.

-Tim


<= /html>= --Apple-Mail-158-427208558-- --Apple-Mail-159-427208600 Content-Disposition: attachment; filename="smime.p7s" Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJ/zCCBO0w ggRWoAMCAQICEBX3i1OyIZLyYjv7fwx/UYkwDQYJKoZIhvcNAQEFBQAwgdgxCzAJBgNVBAYTAlVT MRowGAYDVQQKExFTUkkgSW50ZXJuYXRpb25hbDEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0 d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9y cGEgKGMpMDIxMDAuBgNVBAsTJ0NsYXNzIDIgT25TaXRlIEluZGl2aWR1YWwgU3Vic2NyaWJlciBD QTEdMBsGA1UEAxMUU1JJIEludGVybmF0aW9uYWwgQ0EwHhcNMTIwMTAzMDAwMDAwWhcNMTMwMTAy MjM1OTU5WjCBwjEaMBgGA1UEChQRU1JJIEludGVybmF0aW9uYWwxKDAmBgNVBAsUH0luZm9ybWF0 aW9uIFRlY2hub2xvZ3kgU2VydmljZXMxRjBEBgNVBAsTPXd3dy52ZXJpc2lnbi5jb20vcmVwb3Np dG9yeS9DUFMgSW5jb3JwLiBieSBSZWYuLExJQUIuTFREKGMpOTkxEjAQBgNVBAMTCUphbWVzIEts bzEeMBwGCSqGSIb3DQEJARYPamltLmtsb0BzcmkuY29tMIIBIjANBgkqhkiG9w0BAQEFAA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