Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fACEaHm07757 for ; Mon, 12 Nov 2001 09:36:17 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 2848BD5E3; Mon, 12 Nov 2001 06:36:21 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 1DEE85BE2; Mon, 12 Nov 2001 06:36:21 -0800 (PST) Date: Mon, 12 Nov 2001 06:36:21 -0800 (PST) From: Stephan Szabo To: Jeff Boes Cc: Subject: Re: Timestamp indexes aren't used for ">=" In-Reply-To: <9sok6l$ek7$1@news.tht.net> Message-ID: <20011112063355.I74385-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200111/48 X-Sequence-Number: 2573 On Mon, 12 Nov 2001, Jeff Boes wrote: > In article <20011109145054.H59285-100000@megazone23.bigpanda.com>, > "Stephan Szabo" wrote: > > > How many rows are in the table? Have you run vacuum analyze? > > Sorry, that information was in the original post, but perhaps you missed > it: > > In article <9shhnf$23ks$1@news.tht.net>, "Jeff Boes" > wrote: > > > We have a table which has approximately 400,000 rows. It has 17 columns, > > and 4 indexes. The primary key is a int4 (filled by a sequence), > > additionally we have two more int4 indexes and a timestamp index. > > Yes, VACUUM ANALYZE gets run every 24 hours, and currently the table > grows by some 25K-40K rows per day. Could a factor be the time elapsed > between the VACUUM and the query? Is the 40000 row estimate for the number selected correct? If so, then index scan may very well be a losing plan for this query. Does the forced index scan actually take less time than the the sequence scan?