Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 10826 invoked from network); 13 Jan 2009 13:48:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jan 2009 13:48:21 -0000 Received: (qmail 7953 invoked by uid 500); 13 Jan 2009 13:48:14 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 7923 invoked by uid 500); 13 Jan 2009 13:48:14 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 7912 invoked by uid 99); 13 Jan 2009 13:48:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 05:48:14 -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 (athena.apache.org: domain of erickerickson@gmail.com designates 74.125.46.30 as permitted sender) Received: from [74.125.46.30] (HELO yw-out-2324.google.com) (74.125.46.30) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 13:48:07 +0000 Received: by yw-out-2324.google.com with SMTP id 3so3995ywj.5 for ; Tue, 13 Jan 2009 05:47:46 -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=ZPofbxxN8bVt5y1lg0Q5AqSYtCqYTBLQNBkEx/aFeHk=; b=tawvdDZDXZGKnHMdxzk+Vc05ywz1UIEEv5W9G4R2cmwcybJBvngbnq2jReh7PHM0zR t7lAKOWNZc4T+c85o3wLDI051cUpfTybAqzmmjgV2aR72omiJwEG6QfpNrxX23VKCgsG d0gjY6LthXYiyRFXXgICmK2bfSlE7CKRPIcP4= 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=QLx/+AJtfEW4WXb+xkW3+bjMc1ZKYwN3KUKtGTBtxwC2zlk3RbFz4orec8mdO0+9A9 PB+FA0NzUNx3O2fYSo3+2sYEU6uzXQu4iCu7Cs9bZdmUCVaphefHE0E4cBEieH0D1C0d fK87G4Sdl2Up62TSmLlH8Dxv5KS7eSzh2y2o4= Received: by 10.90.83.18 with SMTP id g18mr5679025agb.40.1231854466678; Tue, 13 Jan 2009 05:47:46 -0800 (PST) Received: by 10.90.27.7 with HTTP; Tue, 13 Jan 2009 05:47:46 -0800 (PST) Message-ID: <359a92830901130547uf0c2507j56f9d807d84b4524@mail.gmail.com> Date: Tue, 13 Jan 2009 08:47:46 -0500 From: "Erick Erickson" To: java-user@lucene.apache.org Subject: Re: Best way to do date sort In-Reply-To: <059101c9755e$556e2ff0$710bc30a@sv.us.sonicwall.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_179166_28012362.1231854466613" References: <059101c9755e$556e2ff0$710bc30a@sv.us.sonicwall.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_179166_28012362.1231854466613 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline This question, along with many possible answers has been discussed many times, so there's a wealth of information in the searchable archive. The short form is "it depends". Do you want to sort? In that case storing a single field will cost you when sorting. Store the coarsest granularity you can. Consider breaking up the date field (i.e. one field containintg YYYYMMDD, perhaps one field containing HHMM or even one field with HH and one with MM). This kind of strategy will save you far more space than worrying about strings vs number. And will sort faster. etc. Best Erick On Tue, Jan 13, 2009 at 4:07 AM, Ganesh wrote: > I am indexing and storing date time with minute resolution. I need to do > date range query and also do sorting on this field. I am having almost 30 > million records spread across 20 database. > > option1: > To index the date time as string > > option2: > To index date, hour and minute separately as number. > > Which option will consume lesser memory? > > Whether date range query will also load all data using FieldImpl? > > Regards > Ganesh > Send instant messages to your online friends http://in.messenger.yahoo.com > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > ------=_Part_179166_28012362.1231854466613--