Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TNx7I-0005Rh-9w for pgsql-performance@postgresql.org; Tue, 16 Oct 2012 02:42:48 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TNx7D-00063J-4o for pgsql-performance@postgresql.org; Tue, 16 Oct 2012 02:42:47 +0000 Received: by mail-pb0-f46.google.com with SMTP id rr4so5519121pbb.19 for ; Mon, 15 Oct 2012 19:42:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=c6RRjm7uEn3jQlkr2MJskrA0u0ACXtTQ71jHSqjIan8=; b=n1i8D0La6F+4Any7SP37OkvCp8yxNcFU5fDyyMEYWKhWTmWdO0NtGqgPc+0nxF7qSY OMpeRGSVufuqLVB0hHhR4lJeuPYZbbud55566PkpTj8GmOfkwYzrFb0vxo4X8Pcit6pD 1JqZwRMnSE37q4OQsaHUnlcAcaiuiiBemDepUAYoC+J9SLM4CLo7oztLqTI7kpCwBj7v vWp2410Zy316L0m0asU4GE2xhkUSiEmypWN2kXByEMZlwAH/kB6kNvC8OtXfsedwKubm uzfyVZyp5ejS3q23n4SoiCAtAQlP36eRrhPj/w6YypC55JQKOd0cl5w87VZzyNMZUtYy emEw== Received: by 10.66.85.227 with SMTP id k3mr37664021paz.79.1350355361939; Mon, 15 Oct 2012 19:42:41 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id vc2sm2707918pbc.64.2012.10.15.19.42.39 (version=SSLv3 cipher=OTHER); Mon, 15 Oct 2012 19:42:41 -0700 (PDT) Message-ID: <507CC99C.90508@ringerc.id.au> Date: Tue, 16 Oct 2012 10:42:36 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: houmanb CC: pgsql-performance@postgresql.org Subject: Re: SELECT AND AGG huge tables References: <1350334756457-5728306.post@n5.nabble.com> In-Reply-To: <1350334756457-5728306.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlOWyOPbcAR/wIvSA7cfK2WvtHaESPdMgfSsq/7D+JJdl0lDElxWLWWOir/vKL0ZJ85Wc0N X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/199 X-Sequence-Number: 48158 On 10/16/2012 04:59 AM, houmanb wrote: > There is an Index on T.c. But would it help to partition the table by T.c? You should really post EXPLAIN ANALYZE for questions like this. See https://wiki.postgresql.org/wiki/Slow_Query_Questions -- Craig Ringer