X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6846153690 for ; Wed, 20 Apr 2005 12:15:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34254-02 for ; Wed, 20 Apr 2005 15:15:42 +0000 (GMT) Received: from localhost.net (cust.89.121.adsl.cistron.nl [195.64.89.121]) by svr1.postgresql.org (Postfix) with ESMTP id 9D34F535D2 for ; Wed, 20 Apr 2005 12:15:42 -0300 (ADT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost.net (Postfix) with ESMTP id 33D5183D5E; Wed, 20 Apr 2005 17:15:39 +0200 (CEST) Message-ID: <42667219.7050907@trust-factory.com> Date: Wed, 20 Apr 2005 17:15:37 +0200 From: Richard van den Berg Organization: Trust Factory User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John A Meinel Cc: pgsql-perform Subject: Re: When are index scans used over seq scans? References: <426665A0.1080102@trust-factory.com> <42666890.1000401@arbash-meinel.com> In-Reply-To: <42666890.1000401@arbash-meinel.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/500 X-Sequence-Number: 11897 John A Meinel wrote: > I believe the problem is that postgres doesn't recognize how restrictive > a date-range is unless it uses constants. And it does when using BETWEEN with int for example? Impressive. :-) > select blah from du WHERE time between '2004-10-10' and '2004-10-15'; > Will properly use the index, because it realizes it only returns a few > rows. Correct, it does. > Probably you should try to find out the status of multi-table > selectivity. It was discussed in the last couple of months. I can't find the posts you are refering to. What is the priciple of multi-table selectivity? Your explanation sounds very plausible.. I don't mind changing the cpu_tuple_cost before running BETWEEN with timestamps, they are easy enough to spot. Thanks, -- Richard van den Berg, CISSP ------------------------------------------- Trust Factory B.V. | www.dna-portal.net Bazarstraat 44a | www.trust-factory.com 2518AK The Hague | Phone: +31 70 3620684 The Netherlands | Fax : +31 70 3603009 -------------------------------------------