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 A0673E525 for ; Sun, 9 Dec 2012 19:05:47 +0000 (UTC) Received: (qmail 35777 invoked by uid 500); 9 Dec 2012 19:05:46 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 35672 invoked by uid 500); 9 Dec 2012 19:05:45 -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 35660 invoked by uid 99); 9 Dec 2012 19:05:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2012 19:05:45 +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 (nike.apache.org: domain of dmitriy.fot@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vc0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2012 19:05:39 +0000 Received: by mail-vc0-f180.google.com with SMTP id p16so1771257vcq.11 for ; Sun, 09 Dec 2012 11:05:18 -0800 (PST) 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=YdL+gJbxqKT6lmdalFnV2CjzHBaVlsdDK9q+onYdadQ=; b=dtOof4cXeaK5nYiPolmWRJa4xk+mp/Ce0AD1ZJnvk5B9LKX1MF95Ew7+/BJXhjB5To M4E6nglYscBbqF0PqSzLQXYYxRtsFkj1AcdiZ3hpLwiCVnMaU1pdyIqf5J8IVQRVYQe8 0QEjYYenLzxVCZSIE+J6d3y0gZUdoRAlnU+nTgpYqqlMYgq+pFdtmFT7pchhh1NcfEvT TWg89z38Mp+nSj00kRWgi+4SLUlJvZ3d8LO/k+gZMfzWndbUxapXNADEWOnYXjhZZLMS Gg2IbVK1P44tSTmE5HixWT8Hwecby2JKpBfzj4OFQ9HlmFSsptCz0r7DEkARdTsksVYn hFJg== Received: by 10.58.198.164 with SMTP id jd4mr7950623vec.34.1355079918086; Sun, 09 Dec 2012 11:05:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.128.162 with HTTP; Sun, 9 Dec 2012 11:04:57 -0800 (PST) In-Reply-To: <857D6498-4A9B-4D8B-BDA2-CFEAA6DD7B2B@couchbase.com> References: <857D6498-4A9B-4D8B-BDA2-CFEAA6DD7B2B@couchbase.com> From: Dmitriy Fot Date: Sun, 9 Dec 2012 20:04:57 +0100 Message-ID: Subject: Re: CouchDB document design for facebook insights To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org great responses, thank you guys, Dmitriy Fot --------------------------------- dmitriy.fot@gmail.com On 7 December 2012 19:51, Jens Alfke wrote: > > On Dec 7, 2012, at 12:32 AM, Dmitriy Fot > wrote: > > - Is it right decision to use an array for the timestamp, or it is > better to use a long? > > Depends what you=92ll be using it for. The array you have is great if you= =92ll be doing a lot of tests based on the components of the date, i.e. all= the posts from November 2012. If you just need to compare times or look at= the interval between two times, a numeric timestamp is best (at the expens= e of not being directly human-readable.) A string timestamp is more compact= than an array and can be converted into either a number or components by t= he JS Date class, although the conversion is somewhat expensive. > > (Another thing to consider about timestamps is whether you need to rememb= er the time zone or not. For most purposes you can just pre-convert everyth= ing to UTC, but for some queries you might want to know the local time, i.e= . =93what time of day do people post most often?=94) > > =97Jens