Re: Need feedback on possible new feature - Mailing list pgsql-general

From Tom Lane
Subject Re: Need feedback on possible new feature
Date
Msg-id 4930.995162942@sss.pgh.pa.us
Whole thread Raw
In response to Re: Need feedback on possible new feature  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Need feedback on possible new feature
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Yes, you actually do the query and the show what took how long. As for
> seperating the parent and child nodes, is that really necessary?

If you're going to label the nodes individually, then yes.  What I take
it you haven't realized yet is that all the nodes get an initialize call
at start of query execution, and they all get a shutdown call at the
end, and the actual execution is thoroughly interleaved.  You're not
going to get any meaningful info by timing the interval from startup
to shutdown.

> Anyway, do you think it's a path worth pursuing? The reason I'm doing it is
> because I know queries where the planner thinks the cost is several million
> and it takes 3 seconds, and also where the cost is a fraction of that but it
> takes minutes. But the queries are complex so it's hard to see where the
> time goes. So, this lets me see.

I think you'll soon find that the really wacko estimates come from
way-off-base row count estimates, and those in turn come from bogus
statistics about the data.  So the part of your plan that involves
instrumenting the number of tuples flowing through each node might
have some value.  Beware of rescans however.

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Need feedback on possible new feature
Next
From: Lincoln Yeoh
Date:
Subject: Re: Need feedback on possible new feature