Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
700 stars 145 forks source link

Fix EXPLAIN tests for 9.4 #77

Closed df7cb closed 10 years ago

df7cb commented 10 years ago

9.4 adds a "Planning time" line to simple "EXPLAIN" output. Fix by using "EXPLAIN (costs off)".

rdunklau commented 10 years ago

Thank you, I'll merge that once 9.4 is out.

df7cb commented 10 years ago

Re: Ronan Dunklau 2014-09-18 Kozea/Multicorn/pull/77/c55998434@github.com

Thank you, I'll merge that once 9.4 is out.

Hi,

the patch is compatible with PG versions 9.0+, so it should be safe to push now.

Christoph

cb@df7cb.de | http://www.df7cb.de/

rdunklau commented 10 years ago

In fact, Multicorn tests explicitly for the costs: the goal of some of these tests is to check that the costs are indeed passed back to the planner.

I did not consider that the only way to disable the planning time would be to also disable the costs altogether

Available options: 1) use the explanation extension to check for those plans http://pgxn.org/dist/explanation/doc/explanation.html 2) lobby for upstream to split the costs and planning time options. 3) only test the resulting plans, and not their associated costs, by merging your pull request

Option 1 would be hard to do, since it would make explanation a test dependency of Multicorn, which would at least feel clunky. Its too late for option 2, had it been detected sooner in the 9.4 development cycle, it would have been possible. Still, it may be considered for future release Which let us with 3 for now.

Anyways, thank you very much for this patch

I'll let this comment open, in case we find a better idea.

df7cb commented 10 years ago

Re: Ronan Dunklau 2014-09-20 Kozea/Multicorn/pull/77/c56264627@github.com

In fact, Multicorn tests explicitly for the costs: the goal of some of these tests is to check that the costs are indeed passed back to the planner.

I did not consider that the only way to disable the planning time would be to also disable the costs altogether

Oh, that's unfortunate. I wasn't aware that the costs were included on purpose.

Available options: 1) use the explanation extension to check for those plans http://pgxn.org/dist/explanation/doc/explanation.html 2) lobby for upstream to split the costs and planning time options. 3) only test the resulting plans, and not their associated costs, by merging your pull request

Option 1 would be hard to do, since it would make explanation a test dependency of Multicorn, which would at least feel clunky. Its too late for option 2, had it been detected sooner in the 9.4 development cycle, it would have been possible. Still, it may be considered for future release Which let us with 3 for now.

I think if we complain loudly, this might get fixed even for 9.4.

There is already a parameter "timing" which can be used to disable the timing output for the plan nodes in the "explain analyze" output. Frankly, I was pretty surprised that "explain (timing off)" didn't disable this plain "explain" timing line, but "costs off" is needed.

Christoph

cb@df7cb.de | http://www.df7cb.de/