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

From Tom Lane
Subject Re: patch - per-tablespace random_page_cost/seq_page_cost
Date
Msg-id 20660.1258241785@sss.pgh.pa.us
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
Robert Haas <robertmhaas@gmail.com> writes:
> I can tell I've lost this argument, but I still don't get it.  Why do
> we care if we have to change the schema?  It's not a lot of work,

Try doing it a few times.  Don't forget to keep psql and pg_dump
apprised of which PG versions contain which columns.  Not to mention
other tools such as pgAdmin that might like to show these settings.
It gets old pretty fast.

> What I'm concerned about with text[] is that I *think* it's going to
> force us to invent an analog of the relcache for tablespaces.

I'm not really convinced of that, but even if we do, so what?  It's not
that much code to have an extra cache watching the syscache traffic.
There's an example in parse_oper.c of a specialized cache that's about
as complicated as this would be.  It's about 150 lines including copious
comments.  We didn't even bother to split it out into its own source
file.

>  With
> hardwired columns, a regular catcache is all we need.  But the
> reloptions stuff is designed to populate a struct, and once we
> populate that struct we have to have someplace to hang it - or I guess
> maybe we could reparse it on every call to cost_seqscan(),
> cost_index(), genericcostestimate(), etc, but that doesn't seem like a
> great idea.

Well, no, we would not do it that way.  I would imagine instead that
plancat.c would be responsible for attaching appropriate cost values to
each RelOptInfo struct, so it'd be more like one lookup per referenced
table per query.  It's possible that a cache would be useful even at
that load level, but I'm not convinced.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: New VACUUM FULL
Next
From: Jeff Davis
Date:
Subject: Re: New VACUUM FULL