Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wpb0h-0002JP-6t for pgsql-performance@arkaria.postgresql.org; Wed, 28 May 2014 10:23:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wpb0g-00049h-8d for pgsql-performance@arkaria.postgresql.org; Wed, 28 May 2014 10:23:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wpb0f-00049a-66 for pgsql-performance@postgresql.org; Wed, 28 May 2014 10:23:01 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Wpb0U-0004QS-NI for pgsql-performance@postgresql.org; Wed, 28 May 2014 10:22:58 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 9AF34283EB; Wed, 28 May 2014 03:22:46 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 913FBB09A6; Wed, 28 May 2014 03:22:46 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 1053B12002A; Wed, 28 May 2014 03:22:56 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Wed, 28 May 2014 03:22:54 -0700 (PDT) Message-ID: <5385B8F3.2000103@vmware.com> Date: Wed, 28 May 2014 13:22:43 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Grzegorz Olszewski , AI Rumman CC: "pgsql-performance@postgresql.org" Subject: Re: Planner doesn't take indexes into account References: , In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.6 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 05/28/2014 12:59 PM, Grzegorz Olszewski wrote: > random_page_cost = 4.0 > seq_page_cost = 1.0 > > There is about 500,000 rows and about 500 new rows each business day. > > About 96% of rows meet given conditions, that is, count shoud be about 480,000. When such a large percentage of the rows match, a sequential scan is indeed a better plan than an index scan. Sequential access is much faster than random access. - Heikki -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance