Thread: vacuumdb --all --analyze-in-stages - wrong order?
Hello
I am looking on --analyze-in-stages option. If I understand well, motivation for this option is a get some minimal statistic for databases in minimal time. But when I tested, I found so iterations are per databases, not per stages - some first database get a maximum statistics and second has zero statistics. Isn't it unpractical?Stage 2
DB a, DB b ...
Stage 3
DB a, DB b, ..
Regards
Pavel
Pavel
On 5/18/14, 3:52 AM, Pavel Stehule wrote: > Hello > > I am looking on --analyze-in-stages option. If I understand well, > motivation for this option is a get some minimal statistic for databases > in minimal time. But when I tested, I found so iterations are per > databases, not per stages - some first database get a maximum statistics > and second has zero statistics. Isn't it unpractical? Yes. Let me see if I can fix that.
On Mon, 2014-05-19 at 13:51 -0400, Peter Eisentraut wrote: > On 5/18/14, 3:52 AM, Pavel Stehule wrote: > > I am looking on --analyze-in-stages option. If I understand well, > > motivation for this option is a get some minimal statistic for databases > > in minimal time. But when I tested, I found so iterations are per > > databases, not per stages - some first database get a maximum statistics > > and second has zero statistics. Isn't it unpractical? > > Yes. Let me see if I can fix that. At long last, here is a patch. If somebody has an idea how to code some of that less confusingly, let me know.
Attachment
<div dir="ltr"><br /><div class="gmail_extra"><br /><br /><div class="gmail_quote">2014-09-04 5:36 GMT+02:00 Peter Eisentraut<span dir="ltr"><<a href="mailto:peter_e@gmx.net" target="_blank">peter_e@gmx.net</a>></span>:<br /><blockquoteclass="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><divclass="">On Mon, 2014-05-19 at 13:51 -0400, Peter Eisentraut wrote:<br /> > On5/18/14, 3:52 AM, Pavel Stehule wrote:<br /></div><div class="">> > I am looking on --analyze-in-stages option. IfI understand well,<br /> > > motivation for this option is a get some minimal statistic for databases<br /> >> in minimal time. But when I tested, I found so iterations are per<br /> > > databases, not per stages - somefirst database get a maximum statistics<br /> > > and second has zero statistics. Isn't it unpractical?<br /> ><br/> > Yes. Let me see if I can fix that.<br /><br /></div>At long last, here is a patch.<br /><br /> If somebodyhas an idea how to code some of that less confusingly, let<br /> me know.<br /><br /></blockquote></div>It is littlebit hard to read. <br /><br /></div><div class="gmail_extra"> /* If stage is -1, then run all stages. Otherwise, we got a stage<br /> * from vacuum_all_databases(), so just run that one. */<br /> for (i = (stage == -1 ? 0 : stage); i < (stage == -1 ? 3 : stage + 1); i++)<br /> {<br /> puts(gettext(stage_messages[i]));<br /> executeCommand(conn, stage_commands[i],progname, echo);<br /> run_vacuum_command(conn, sql.data, echo, dbname, table,progname);<br /> }<br /><br /></div><div class="gmail_extra">maybe better be more verbose - and it canbe in alone function, because it is "analyze only"<br /><br /></div><div class="gmail_extra">if (stage == -1)<br /></div><divclass="gmail_extra">{<br /></div><div class="gmail_extra"> for (i = 0; i < 3; i++)<br /> {<br /> puts(gettext(stage_messages[i]));<br /> executeCommand(conn, stage_commands[i], progname, echo);<br /> run_vacuum_command(conn, sql.data, echo, dbname, table, progname);<br /> }<br />}<br /></div><div class="gmail_extra">else<br/>{<br /> puts(gettext(stage_messages[stage]));<br /> executeCommand(conn, stage_commands[stage],progname, echo);<br /> run_vacuum_command(conn, sql.data, echo, dbname, table, progname);<br />}<br/><br /></div><div class="gmail_extra">Regards<br /><br />Pavel<br /></div></div>
On 9/4/14 4:23 PM, Pavel Stehule wrote: > It is little bit hard to read. > maybe better be more verbose - and it can be in alone function, because > it is "analyze only" > > if (stage == -1) > { > for (i = 0; i < 3; i++) > { > puts(gettext(stage_messages[i])); > executeCommand(conn, stage_commands[i], progname, echo); > run_vacuum_command(conn, sql.data, echo, dbname, table, progname); > } > } > else > { > puts(gettext(stage_messages[stage])); > executeCommand(conn, stage_commands[stage], progname, echo); > run_vacuum_command(conn, sql.data, echo, dbname, table, progname); > } Done that way, thanks!
2014-09-12 3:44 GMT+02:00 Peter Eisentraut <peter_e@gmx.net>:
On 9/4/14 4:23 PM, Pavel Stehule wrote:
> It is little bit hard to read.
> maybe better be more verbose - and it can be in alone function, because
> it is "analyze only"
>
> if (stage == -1)
> {
> for (i = 0; i < 3; i++)
> {
> puts(gettext(stage_messages[i]));
> executeCommand(conn, stage_commands[i], progname, echo);
> run_vacuum_command(conn, sql.data, echo, dbname, table, progname);
> }
> }
> else
> {
> puts(gettext(stage_messages[stage]));
> executeCommand(conn, stage_commands[stage], progname, echo);
> run_vacuum_command(conn, sql.data, echo, dbname, table, progname);
> }
Done that way, thanks!
Thank you
It is interesting feature
Pavel
Pavel