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 834D9528C7 for ; Wed, 22 Jun 2005 10:51:00 -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 25764-03 for ; Wed, 22 Jun 2005 13:50:50 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1DBC75293C for ; Wed, 22 Jun 2005 10:50:49 -0300 (ADT) 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 j5MDod7p027061; Wed, 22 Jun 2005 09:50:39 -0400 (EDT) To: Tobias Brox Cc: Kjell Tore Fossbakk , Michael Glaesemann , pgsql-performance@postgresql.org Subject: Re: Querying 19million records very slowly In-reply-to: <20050622093644.GA7839@tobias> References: <42B8719A.6040809@refractions.net> <20050622080357.GW7839@tobias> <20050622083921.GZ7839@tobias> <8B2836FF-F335-49A4-8131-8EF2D02100F9@myrealbox.com> <20050622093644.GA7839@tobias> Comments: In-reply-to Tobias Brox message dated "Wed, 22 Jun 2005 17:36:44 +0800" Date: Wed, 22 Jun 2005 09:50:39 -0400 Message-ID: <27060.1119448239@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/433 X-Sequence-Number: 13070 Tobias Brox writes: >> time (datetime) > '2005-06-21 10:36:22+02' >> or >> time (timestamp) > 'some timestamp pointing to yesterday' > If I have understood it correctly, the planner will recognize the timestamp > and compare it with the statistics in the first example but not in the > second, and thus it will be more likely to use index scan on the first one > and seqscan on the second. That statement is true for releases before 8.0. Kjell has not at any point told us what PG version he is running, unless I missed it... regards, tom lane