pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Boley <npboley@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Jesper Krogh <jesper@krogh.cc>
Cc: pgsql-performance@postgresql.org
Subject: Re: reducing random_page_cost from 4 to 2 to force index scan
Date: Mon, 16 May 2011 15:41:00 -0400
Message-ID: <20553.1305574860@sss.pgh.pa.us> (raw)
In-Reply-To: <BANLkTimOEkO55L4g8u7-zyXwTnxFDjhpbA@mail.gmail.com>
References: <BANLkTikZhYc+h1=YDJfXwZEZc1tN3_VwCg@mail.gmail.com>
	<4DB6F4BB020000250003CEB9@gw.wicourts.gov>
	<BANLkTindB68ogMg8zrR7GrYEV+mQQddj0A@mail.gmail.com>
	<BANLkTik6OaVkJGEjs5--vcynUE36mWbzbg@mail.gmail.com>
	<2823.1305314437@sss.pgh.pa.us>
	<BANLkTimTqXAy7_KqQz_OW1RvMbDd9ojfqg@mail.gmail.com>
	<4DCD90F5.2010501@agliodbs.com>
	<BANLkTikcVUeRfocJPe_W+jfi5k1+gcLnxg@mail.gmail.com>
	<4DD0195A.9040305@agliodbs.com>
	<BANLkTika=a95=Pm97Evi-Q7e_9vs4FnkCQ@mail.gmail.com>
	<4DD07855.8080907@postnewspapers.com.au>
	<4DD07B4E.1020503@2ndquadrant.com>
	<4DD0AB16.5060808@krogh.cc>
	<4DD0ACD0.1090801@krogh.cc>
	<BANLkTimw2xWYQ_Hz4vtLXx-2nZRjRfoMMw@mail.gmail.com>
	<18337.1305566693@sss.pgh.pa.us>
	<BANLkTimOEkO55L4g8u7-zyXwTnxFDjhpbA@mail.gmail.com>

Nathan Boley <npboley@gmail.com> writes:
>> The accesses to an index are far more likely to be clustered than the
>> accesses to the underlying table, because the index is organized in a
>> way that's application-meaningful and the table not so much.

> So, to clarify, are you saying that if query were actually requesting
> rows uniformly random, then there would be no reason to suspect that
> index accesses would have hotspots? It seems like the index structure
> ( ie, the top node in b-trees ) could also get in the way.

The upper nodes would tend to stay in cache, yes, but we already assume
that in the index access cost model, in a kind of indirect way: the
model only considers leaf-page accesses in the first place ;-)

			regards, tom lane



view thread (43+ messages)  latest in thread

Message-ID: <20553.1305574860@sss.pgh.pa.us>
Permalink:  ../20553.1305574860@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20553.1305574860@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, npboley@gmail.com, jeff.janes@gmail.com, jesper@krogh.cc
  Subject: Re: reducing random_page_cost from 4 to 2 to force index scan
  In-Reply-To: <20553.1305574860@sss.pgh.pa.us>

* 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