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 E645A329E70 for ; Sun, 3 Oct 2004 00:44:25 +0100 (BST) 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 09422-09 for ; Sat, 2 Oct 2004 23:44:19 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6EC91329E53 for ; Sun, 3 Oct 2004 00:44:21 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i92NiLi8027190; Sat, 2 Oct 2004 19:44:22 -0400 (EDT) To: Hannu Krosing Cc: Josh Berkus , Dustin Sallings , pgsql-performance@postgresql.org Subject: Re: inconsistent/weird index usage In-reply-to: <1096759241.5508.2.camel@fuji.krosing.net> References: <6FA9AB99-1373-11D9-A87D-000A957659CC@spy.net> <9345.1096641526@sss.pgh.pa.us> <200410010929.36026.josh@agliodbs.com> <10775.1096648455@sss.pgh.pa.us> <1096759241.5508.2.camel@fuji.krosing.net> Comments: In-reply-to Hannu Krosing message dated "Sun, 03 Oct 2004 02:20:41 +0300" Date: Sat, 02 Oct 2004 19:44:21 -0400 Message-ID: <27189.1096760661@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/22 X-Sequence-Number: 8498 Hannu Krosing writes: >> No. It's not fixed as of CVS tip either, although there was some talk >> of doing something in time for 8.0. > That's weird - my 7.4.2 databases did not consider (now()-'15 > min'::interval) to be a constant whereas 7.4.5 does (i.e. it does use > index scan on index on datetime column) The question isn't whether it can use it as an indexscan bound; the question is whether it can derive an accurate rowcount estimate. The issue is exactly that STABLE functions work for one but not the other. regards, tom lane