Re: patch - per-tablespace random_page_cost/seq_page_cost - Mailing list pgsql-hackers

From Robert Haas
Subject Re: patch - per-tablespace random_page_cost/seq_page_cost
Date
Msg-id 603c8f070911262016p687ed118od34327b1f2e5067a@mail.gmail.com
Whole thread Raw
In response to Re: patch - per-tablespace random_page_cost/seq_page_cost  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: patch - per-tablespace random_page_cost/seq_page_cost
List pgsql-hackers
On Thu, Nov 26, 2009 at 4:25 PM, Robert Haas <robertmhaas@gmail.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

pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION
Next
From: "Albe Laurenz"
Date:
Subject: Re: unknown libpq service entries ignored