Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 3065147743D for ; Wed, 13 Mar 2002 16:21:41 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 76058D5F7; Wed, 13 Mar 2002 13:21:38 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 6B7E95BFD; Wed, 13 Mar 2002 13:21:38 -0800 (PST) Date: Wed, 13 Mar 2002 13:21:38 -0800 (PST) From: Stephan Szabo To: Nick Fankhauser Cc: pgsql-admin Subject: Re: Optimizing a condition based on an a very unequally In-Reply-To: Message-ID: <20020313131759.B86474-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/193 X-Sequence-Number: 3727 On Wed, 13 Mar 2002, Nick Fankhauser wrote: > Thanks for the answer! ...but now I have more questions: > > Is it true that if I use this condition in a join that further constrains > the results, this might use the index? If there were other conditions, it may do so. > Does PGSQL know that few or many rows will be returned because of data > gathered from the last vacuum? I'd guess the last analyze (or vacuum analyze). > What do you mean by "tuple validity?" can't this query be resolved entirely > based on the index? Not currently, because the index doesn't know if the row can be seen by your transaction. There may be rows that are valid for some transactions but not yours that also have index entries.