pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Grzegorz Olszewski <grzegorz.olszewski@outlook.com>
To: AI Rumman <rummandba@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Planner doesn't take indexes into account
Date: Wed, 28 May 2014 13:22:43 +0300
Message-ID: <5385B8F3.2000103@vmware.com> (raw)
In-Reply-To: <DUB126-W305F8E82EBE7215F89435A91250@phx.gbl>
References: <DUB126-W4724F21FDFBF1316E4FF90913A0@phx.gbl>
	<CAGoODpfb_3yWrN5N4P-8fL5Q0Tz0ZOqSL-HiVLrY0FCE=_9b9A@mail.gmail.com>
	<DUB126-W305F8E82EBE7215F89435A91250@phx.gbl>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

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



view thread (6+ messages)  latest in thread

Message-ID: <5385B8F3.2000103@vmware.com>
Permalink:  ../5385B8F3.2000103@vmware.com/
Also on:    postgresql.org/message-id/5385B8F3.2000103@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: hlinnakangas@vmware.com, grzegorz.olszewski@outlook.com, rummandba@gmail.com
  Subject: Re: Planner doesn't take indexes into account
  In-Reply-To: <5385B8F3.2000103@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox