powa-team / pg_qualstats

A PostgreSQL extension for collecting statistics about predicates, helping find what indices are missing
Other
274 stars 26 forks source link

pgqs_collectNodeStats is not updating ancestors #10

Open tvondra opened 7 years ago

tvondra commented 7 years ago

pgqs_collectNodeStats fails to update ancestors before processing sub-plans. It needs to do

ancestors = lcons(planstate, ancestors);

before processing initPlans, and removing the planstate at the end. See how ExplainNode in explain.c (around line 1593) does that, depending on haschildren variable.