Skip site navigation (1) Skip section navigation (2)

Re: patch - per-tablespace random_page_cost/seq_page_cost

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: patch - per-tablespace random_page_cost/seq_page_cost
Date: 2009-11-27 04:16:52
Message-ID: 603c8f070911262016p687ed118od34327b1f2e5067a@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Nov 26, 2009 at 4:25 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Current version of patch is attached.  I've revised it to use the
> reloptions stuff, but I don't think it's committable as-is because it
> currently thinks that extracting options from a pg_tablespace tuple is
> a cheap operation, which was true in the non-reloptions-based
> implementation but is less true now.  At least, some benchmarking
> needs to be done to figure out whether and to what extent this is an
> issue.

Hmm.  I'm not able to reliably detect a performance difference between
unpatched CVS HEAD (er... git master branch) and same with
spcoptions-v2.patch applied.  I figured that if there were going to be
an impact, it would be most likely to manifest itself in a query that
touches lots and lots of tables but does very little actual work.  So
I used the attached script to create 200 empty tables, 100 in the
default tablespace and 100 in tablespace "dork" (also known as, why I
am working on this at 11 PM on Thanksgiving).  Then I did:

SELECT * FROM a1, a2, a3, ..., a100;

...and likewise for the bn.  I tried this on an unpatched install and
also with the patch applied, with and without options set on
tablespace dork.  I tried it a couple of times and the times were
pretty consistent on any given run, but bounced around enough between
runs that I can't say with any confidence that this patch makes any
difference one way or the other.

So it seems as if there is little reason to worry about caching, as
Tom suspected, unless someone sees a flaw in my testing methodology.
It might matter more in the future, if we have a larger number of
tablespace options, but we could always add a cache then if need be.

...Robert

Attachment: many-tables.sql
Description: application/octet-stream (360 bytes)

In response to

Responses

pgsql-hackers by date

Next:From: Albe LaurenzDate: 2009-11-27 07:05:04
Subject: Re: unknown libpq service entries ignored
Previous:From: Daniel FarinaDate: 2009-11-27 02:30:08
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group