pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Jim C. Nasby <decibel@decibel.org>
Cc: Rick Schumeyer <rschumeyer@ieee.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: index scan on =, but not < ?
Date: Tue, 8 Mar 2005 23:20:20 -0600
Message-ID: <20050309052020.GB1569@wolff.to> (raw)
In-Reply-To: <20050309045519.GA509@decibel.org>
References: <001f01c5240d$a920c8c0$0200a8c0@dell8200>
	<20050309043821.GA1569@wolff.to>
	<20050309045519.GA509@decibel.org>

On Tue, Mar 08, 2005 at 22:55:19 -0600,
  "Jim C. Nasby" <decibel@decibel.org> wrote:
> On Tue, Mar 08, 2005 at 10:38:21PM -0600, Bruno Wolff III wrote:
> > Not exactly. If the number of rows to be examined is on the order of 5%
> > of the table, an index scan will probably be slower than a sequential
> > scan. The visibility issue makes index scans slower in the case that
> 
> Shouldn't that be 50%?

No. When you are doing an index scan of a significant part of the table,
you will fetch some heap pages more than once. You will also be fetching
blocks out of order, so you will lose out on read ahead optimization
by the OS. This assumes that you don't get a lot of cache hits on the
help pages. If a significant portion of the table is cached, then the
trade off point will be at a higher percentage of the table.



view thread (12+ messages)  latest in thread

Message-ID: <20050309052020.GB1569@wolff.to>
Permalink:  ../20050309052020.GB1569@wolff.to/
Also on:    postgresql.org/message-id/20050309052020.GB1569@wolff.to

 · 

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: bruno@wolff.to, decibel@decibel.org, rschumeyer@ieee.org
  Subject: Re: index scan on =, but not < ?
  In-Reply-To: <20050309052020.GB1569@wolff.to>

* 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