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'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.
Cheers,
Jeff