Re: Simulating Clog Contention - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Simulating Clog Contention
Date
Msg-id CA+TgmoY=8y67JcKSFKeoXdSd0Bn+mB++y6mTr3OtKznY7=shNg@mail.gmail.com
Whole thread Raw
In response to Re: Simulating Clog Contention  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Mon, Jan 30, 2012 at 10:48 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> On Mon, Jan 30, 2012 at 7:24 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Sat, Jan 28, 2012 at 3:32 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
>>>> I think that even in normal (non-initialization) usage, this message
>>>> should be suppressed when the provided scale factor
>>>> is equal to the pgbench_branches table count.
>>>
>>> The attached patch does just that.  There is probably no reason to
>>> warn people that we are doing what they told us to, but not for the
>>> reason they think.
>>
>> In my opinion, a more sensible approach than anything we're doing
>> right now would be to outright *reject* options that will only be
>> ignored.  If -s isn't supported except with -i, then trying to specify
>> -s without -i should just error out at the options-parsing stage,
>> before we even try to connect to the database.  It's not very helpful
>> to accept options and then ignore them, and we have many instances of
>> that right now: initialization-only switches are accepted and ignored
>> when not initializing, and run-only switches are accepted and ignored
>> with initializing.
>
> I like the ability to say, effectively, "I think I had previously did
> the initialization with -s 40, if I actually didn't then scream at me,
> and if I did then go ahead and do the pgbench I just asked for".
> But, since it does unconditionally report the scale actually used and
> I just have to have the discipline to go look at the result, I can see
> where this is perhaps overkill.   In my own (non-PG-related) code,
> when I have tasks that have to be run in multiple phases that can get
> out of sync if I am not careful, I like to be able to specify the
> flags even in the "unused" invocation, so that the code can verify I
> am being consistent.  Code is better at that than I am.

I guess my point is - if we're gonna have it do that, then shouldn't
we actually *error out* if the scales don't match, not just print a
warning and then charge ahead?

> I'm not sure I know what all would be incompatible with what.  I could
> start drawing that matrix up once the API stabilizes, but I think you
> are still planning on whacking this -I option around a bit.

It's mostly that everything in the "initialization options" section of
pgbench --help is incompatible with everything in the "benchmarking
options" section, and the other way around.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Simulating Clog Contention
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?