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

per table random-page-cost?

From: marcin mank <marcin(dot)mank(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: per table random-page-cost?
Date: 2009-10-19 21:08:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Currently random_page_cost is a GUC. I propose that this could be set per-table.

I think this is a good idea for widely-wanted planner hints. This way
You can say "I do NOT want this table to be index-scanned, because I
know it is not cached" by setting it`s random_page_cost to a large
value (an obviously You can do the other way around, when setting the
random_page_cost to 1 You say "I don`t care how You fetch the pages,
they are all in cache")

The value for the per-table setting could be inferred from
pg_stat(io)?.*tables . We could have a tool to suggest appropriate

We could call it something like cached_percentage (and have the cost
of a random tuple fetch be inferred from the global random_page_cost,
seq_tuple_cost and the per-table cached_percentage). Then we could set
the global random_page_cost to a sane value like 200. Now one can
wonder why the planner works while having such blantantly unrealistic
values for random_page_cost :)

What do You think?

Marcin Mank


pgsql-hackers by date

Next:From: Robert HaasDate: 2009-10-19 21:14:40
Subject: Re: per table random-page-cost?
Previous:From: Eric B. RidgeDate: 2009-10-19 21:01:07
Subject: Re: Controlling changes in plpgsql variable resolution

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