{"shas":[["b3aaf9081a1a95c245fd605dcf02c91b3a5c3a29","ffeaa947aef224da9ba99b6a18bdd74288df0e3e@sss.pgh.pa.us","Rearrange planner to save the whole PlannerInfo (subroot) for a subquery.\n\nFormerly, set_subquery_pathlist and other creators of plans for subqueries\nsaved only the rangetable and rowMarks lists from the lower-level\nPlannerInfo.  But there's no reason not to remember the whole PlannerInfo,\nand indeed this turns out to simplify matters in a number of places.\n\nThe immediate reason for doing this was so that the subroot will still be\naccessible when we're trying to extract column statistics out of an\nalready-planned subquery.  But now that I've done it, it seems like a good\ncode-beautification effort in its own right.\n\nI also chose to get rid of the transient subrtable and subrowmark fields in\nSubqueryScan nodes, in favor of having setrefs.c look up the subquery's\nRelOptInfo.  That required changing all the APIs in setrefs.c to pass\nPlannerInfo not PlannerGlobal, which was a large but quite mechanical\ntransformation.\n\nOne side-effect not foreseen at the beginning is that this finally broke\ninheritance_planner's assumption that replanning the same subquery RTE N\ntimes would necessarily give interchangeable results each time.  That\nassumption was always pretty risky, but now we really have to make a\nseparate RTE for each instance so that there's a place to carry the\nseparate subroots.","Tom Lane"]],"ref":"refs/heads/master","size":1,"head":"b3aaf9081a1a95c245fd605dcf02c91b3a5c3a29","push_id":41588305}