X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EF0A4D1B532; Mon, 10 Nov 2003 22:51:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 02423-05; Mon, 10 Nov 2003 18:51:12 -0400 (AST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id D4DE1D1B4E4; Mon, 10 Nov 2003 18:51:09 -0400 (AST) Received: from tokyo.samurai.com (d226-89-59.home.cgocable.net [24.226.89.59]) by bob.samurai.com (Postfix) with ESMTP id 512951EB9; Mon, 10 Nov 2003 17:51:11 -0500 (EST) To: "Patrick Hatcher" Cc: scrappy@postgresql.org, pgsql-performance@postgresql.org Subject: Re: *very* slow query to summarize data for a month ... From: Neil Conway In-Reply-To: (Patrick Hatcher's message of "Mon, 10 Nov 2003 12:31:08 -0800") References: Date: Mon, 10 Nov 2003 17:51:10 -0500 Message-ID: <87u15bx2g1.fsf@mailbox.samurai.com> User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/31 X-Sequence-Number: 4591 "Patrick Hatcher" writes: > Do you have an index on ts.bytes? Josh had suggested this and after I put > it on my summed fields, I saw a speed increase. What's the reasoning behind this? ISTM that sum() should never use an index, nor would it benefit from using one. -Neil