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 48F5852812 for ; Wed, 22 Jun 2005 05:04:07 -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 52036-03 for ; Wed, 22 Jun 2005 08:04:05 +0000 (GMT) Received: from exobox.exoweb.net (unknown [221.122.43.98]) by svr1.postgresql.org (Postfix) with SMTP id 4563E5285C for ; Wed, 22 Jun 2005 05:03:58 -0300 (ADT) Received: (qmail 24633 invoked from network); 22 Jun 2005 08:03:57 -0000 Received: from exo185.exoweb.net (HELO tobias.nordicbet.invalid) (192.168.0.185) by 0 with SMTP; 22 Jun 2005 08:03:57 -0000 Received: by tobias.nordicbet.invalid (Postfix, from userid 500) id 828EAE0D07; Wed, 22 Jun 2005 16:03:57 +0800 (CST) Date: Wed, 22 Jun 2005 16:03:57 +0800 From: Tobias Brox To: Kjell Tore Fossbakk Cc: pgsql-performance@postgresql.org Subject: Re: Querying 19million records very slowly Message-ID: <20050622080357.GW7839@tobias> References: <42B8719A.6040809@refractions.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Group Nordicbet User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/424 X-Sequence-Number: 13061 [Kjell Tore Fossbakk - Wed at 09:45:22AM +0200] > database=> explain analyze select count(*) from test where p1=53 and > time > now() - interval '24 hours' ; Sorry to say that I have not followed the entire thread neither read the entire email I'm replying to, but I have a quick hint on this one (ref my earlier thread about timestamp indices) - the postgresql planner will generally behave smarter when using a fixed timestamp (typically generated by the app server) than logics based on now(). One of my colleagues also claimed that he found the usage of localtimestamp faster than now(). -- Tobias Brox, +86-13521622905 Nordicbet, IT dept