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

From Tom Lane
Subject Re: per-tablespace random_page_cost/seq_page_cost
Date
Msg-id 25799.1256696283@sss.pgh.pa.us
Whole thread Raw
In response to Re: per-tablespace random_page_cost/seq_page_cost  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: per-tablespace random_page_cost/seq_page_cost
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> For things like autovacuum options, the actual representation probably
> doesn't matter much because I'm guessing that the amount of work being
> done by vacuum dwarfs the parsing cost, and it's a background task
> anyway.  But this seems like a less solid argument for things like
> fillfactor and the proposed per-tablespace
> seq_page_cost/random_page_cost, which will be accessed by many queries
> and in the latter case often more than once.  Ideally (or so it seems
> to me) you'd like to fetch those things out of Form_pg_whatever rather
> than parsing text strings to get at 'em.

I think efficiency arguments here are hogwash.  In the first place,
we'd certainly cache the results someplace (relcache or something like
it) if retrieve performance seems to be a bottleneck at all.  In the
second place, composite types are so hugely inefficient as to swamp any
gain you'd get from the columns being the right type once you got at
them.  (atoi and friends are cheap by comparison.)

It's possible that changing this is worthwhile on logical cleanliness
grounds; but I think it will be a net loss in efficiency, and definitely
a net loss in terms of code complexity at the C level.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: per-tablespace random_page_cost/seq_page_cost
Next
From: Itagaki Takahiro
Date:
Subject: pg_read_file() and non-ascii input file