Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 90200 invoked from network); 10 Jan 2009 08:32:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2009 08:32:16 -0000 Received: (qmail 89588 invoked by uid 500); 10 Jan 2009 08:32:15 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 89561 invoked by uid 500); 10 Jan 2009 08:32:15 -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 89550 invoked by uid 99); 10 Jan 2009 08:32:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 00:32:15 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of webjogger@gmail.com designates 209.85.218.10 as permitted sender) Received: from [209.85.218.10] (HELO mail-bw0-f10.google.com) (209.85.218.10) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 08:32:05 +0000 Received: by bwz3 with SMTP id 3so423764bwz.11 for ; Sat, 10 Jan 2009 00:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=htifGZoogrhRAqLOLhigZWvN/ZpoWJVmFa8uVpJjwTc=; b=B8e6kQXVyF1TA5px681VfEW4P7G0PCsT+qgKJ01wtgbiYL2IhE/yNaSKTQxYe2sZnZ HRkn/S68KxeRayBuVjklMcH8dPfinNL6OokWAmE8SJkWnjZvOTGTF6yEhIExjBO8iPA9 nq3e8AwTsJtWJhyIA2TPPpwVR6mA2HBCtTwag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=TZ43aWzdUiado4adLbVV6VTVbySbSc/kp0IWkEi1P/rtltXqdfUSyLfhN0SFKed+Rn Xla9RkJKxFNqzRgLxBOn5a94Gr9foiIMqiUZi/anzbvkGHaHhsz0LCo6TKRpRJa8/Zzf 4GD60JJelKB9s6TMDyZp4oFs8fOA56nyskBCo= Received: by 10.103.178.17 with SMTP id f17mr9521883mup.45.1231576305224; Sat, 10 Jan 2009 00:31:45 -0800 (PST) Received: by 10.103.246.16 with HTTP; Sat, 10 Jan 2009 00:31:45 -0800 (PST) Message-ID: <4c69d7170901100031s33f19cfv70e6fcc10d74b81b@mail.gmail.com> Date: Sat, 10 Jan 2009 00:31:45 -0800 From: "paul jobs" To: user@couchdb.apache.org Subject: Re: Couchdb views using time In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_217590_23963298.1231576305219" References: <4c69d7170901091547w6f43b7c1wf9612ff459ba8c7a@mail.gmail.com> <4c69d7170901091547g2a42a2ccnccfdc38482b4e5c4@mail.gmail.com> <4c69d7170901092341j512473e3wc6f31c7bcf78619d@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_217590_23963298.1231576305219 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline so paul what you are saying is this so if we use sortable_timestamp or created/date/time in my case the rows are automatically sorted in descending order and use the 1st 100 u get and process them in python is it possible to construct this in the view itself and get like the 340 items that are created in the last one hour without resorting to python Sorry if i am asking something basic Thanks On Fri, Jan 9, 2009 at 11:51 PM, Paul Davis wrote: > On Fri, Jan 9, 2009 at 9:41 PM, paul jobs wrote: > > Thanks chris > > Ok, but how to get the list of items that are in the last one hour, since > > the list is about 3 million users > > Paul, > > emit([doc.user, doc.sortable_timestamp], null) > > Paul > > > > so extracting the 3 million using this view and then processing the > results > > in python doesnt seem feasible > > thanks a lot > > > > On Fri, Jan 9, 2009 at 10:52 PM, Chris Anderson > wrote: > > > >> just have a map view that calls emit(doc.timestamp, null) as long as > >> your timestamp format sorts correctly. > >> > >> On Fri, Jan 9, 2009 at 3:47 PM, paul jobs wrote: > >> > This is very useful for eg., to delete posts older than one day > >> > get users who logged in the last 1 hour etc > >> > > >> > On Fri, Jan 9, 2009 at 3:47 PM, paul jobs > wrote: > >> > > >> >> select * from users where ((extract('epoch' from now()) - > >> extract('epoch' > >> >> from last_login)) < 3000000) order by last_login DESC > >> >> > >> >> is it possible to construct such views using couchdb permanent views? > >> >> > >> >> thanks > >> >> > >> > > >> > >> > >> > >> -- > >> Chris Anderson > >> http://jchris.mfdz.com > >> > > > ------=_Part_217590_23963298.1231576305219--