Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0D70EB5DBD3 for ; Mon, 16 May 2011 16:41:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 60647-10 for ; Mon, 16 May 2011 19:41:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 02897B5DBD2 for ; Mon, 16 May 2011 16:41:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p4GJf1It020554; Mon, 16 May 2011 15:41:01 -0400 (EDT) To: Nathan Boley cc: Jeff Janes , Jesper Krogh , pgsql-performance@postgresql.org Subject: Re: reducing random_page_cost from 4 to 2 to force index scan In-reply-to: References: <4DB6F4BB020000250003CEB9@gw.wicourts.gov> <2823.1305314437@sss.pgh.pa.us> <4DCD90F5.2010501@agliodbs.com> <4DD0195A.9040305@agliodbs.com> <4DD07855.8080907@postnewspapers.com.au> <4DD07B4E.1020503@2ndquadrant.com> <4DD0AB16.5060808@krogh.cc> <4DD0ACD0.1090801@krogh.cc> <18337.1305566693@sss.pgh.pa.us> Comments: In-reply-to Nathan Boley message dated "Mon, 16 May 2011 12:10:37 -0700" Date: Mon, 16 May 2011 15:41:00 -0400 Message-ID: <20553.1305574860@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/250 X-Sequence-Number: 43759 Nathan Boley 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