Re: Tablespace and cpu costs

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Subject: Re: Tablespace and cpu costs
Date: 2004-08-19 10:30:42
Message-ID: 41248152.5020104@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Sherry wrote:

> On Wed, 18 Aug 2004, Gaetano Mendola wrote:
>
>
>>Gavin Sherry wrote:
>>
>>
>>>On Wed, 18 Aug 2004, Gaetano Mendola wrote:
>>>
>>>>-----BEGIN PGP SIGNED MESSAGE-----
>>>>Hash: SHA1
>>>>
>>>>Hi all,
>>>>now that we have the tablespace support don't you think that
>>>>each tablespace needs his own costs instead of a system wide
>>>>one ?
>>>>
>>>>I searched in the archives and on the TODO list without success.
>>>
>>>
>>>Yep. I've looked at this but didn't think it necessary for the first stage
>>>of implementation.
>>>
>>>I definately plan to do it for 8.1
>>
>>Do you have an Idea on how you want implement this ( usage side ) ?
>>
>
>
> Well, as far as I can tell there are two ways we could do it without
> reinventing the wheel -- but both are ugly.
>
> The first is to add a parameter to CREATE TABLESPACE and ALTER TABLESPACE
> called RANDOMPAGECOST (or something like that) which allows users to set
> the random page cost for a given tablespace. I'm undecided as to whether
> they should be able to set the sequential scan cost. That seems
> reasonable too at first look.
>
> The second option is to have a pg_tablespace.conf file which defines
> tablespace specific settings in some way or another.
>
> Either way, the data will be feed into the planner so that the costing
> routines will be able to use them.

That is the goal.

> Anyone else got some thoughts on how we could do this in a cleaner manner?

I think we need both, I think could be also usefull add a STORE option:

ALTER TABLESPACE RANDOMPAGECOST 0.001 STORE

if the STORE is present then the pg_tablespace.conf is updated

this could be argued with the fact that we do not have SET cpu_costs STORE bu this
doesn't mean that we can not have it in the future :-)

I think is also usefull insert it in the dump "as comment" before the tablespace
creation, this in order to don't loose these setting.

Regards
Gaetano Mendola

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 2004-08-19 11:01:05 Re: Does psql use nested transactions?
Previous Message Gaetano Mendola 2004-08-19 10:10:24 Re: [HACKERS] 8.0 libpq: missing get_home_path()