Received: from zukerman-1.dsl.speakeasy.net (zukerman-1.dsl.speakeasy.net [216.254.75.142]) by hub.org (8.10.1/8.10.1) with ESMTP id e6VDiJB36995 for ; Mon, 31 Jul 2000 09:44:20 -0400 (EDT) Received: from (matt.w80.math-hat.com) [216.254.75.141] by zukerman-1.dsl.speakeasy.net with esmtp (Exim 3.12 #1 (Debian)) id 13JFr2-00034Y-00; Mon, 31 Jul 2000 09:43:40 -0400 Received: from zukerman by matt.w80.math-hat.com with local (Exim 3.12 #1 (Debian)) id 13JFrf-0000pj-00 for ; Mon, 31 Jul 2000 09:44:19 -0400 To: pgsql-sql@postgresql.org Subject: Indices and time spans From: Itai Zukerman Date: 31 Jul 2000 09:44:18 -0400 Message-ID: <87g0oqbej1.fsf@matt.w80.math-hat.com> Lines: 14 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200007/284 I have this: SELECT ... FROM trade, entry WHERE AGE( CURRENT_TIMESTAMP, posted ) <= '5 minutes'::TIMESPAN AND trade.entryId = entry.entryId That is, fetch all trades executed in the last 5 minutes. This query seems to run pretty slowly when trade is filled. Putting an index on trade ( posted ) doesn't seem to help any (the same query plan is generated). Any suggestions? -itai