[HACKERS] Unused field of ProjectionPath - Mailing list pgsql-hackers

From Antonin Houska
Subject [HACKERS] Unused field of ProjectionPath
Date
Msg-id 18467.1501762770@localhost
Whole thread Raw
Responses Re: [HACKERS] Unused field of ProjectionPath  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I've noticed that the dummypp field of ProjectionPath is set but never read.

If the only possible change between the path and plan creation time is that
the projection path and the subpath targetlists become different, then dummypp
could be used this way:

diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
new file mode 100644
index 5c934f2..1910d3f
*** a/src/backend/optimizer/plan/createplan.c
--- b/src/backend/optimizer/plan/createplan.c
*************** create_projection_plan(PlannerInfo *root
*** 1572,1578 ****        * not using.)        */       if (is_projection_capable_path(best_path->subpath) ||
!               tlist_same_exprs(tlist, subplan->targetlist))       {               /* Don't need a separate Result,
justassign tlist to subplan */               plan = subplan; 
--- 1572,1578 ----        * not using.)        */       if (is_projection_capable_path(best_path->subpath) ||
!               (best_path->dummypp && tlist_same_exprs(tlist, subplan->targetlist)))       {               /* Don't
needa separate Result, just assign tlist to subplan */               plan = subplan; 


On the other hand, if the targetlists can also be different at path creation
time and equal at plan creation time, the lists do always need comparison at
plan creation time and the dummypp field should probably be removed.


--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de, http://www.cybertec.at



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [HACKERS] Support for Secure Transport SSL library on macOS as OpenSSL alternative
Next
From: Rushabh Lathia
Date:
Subject: Re: [HACKERS] reload-through-the-top-parent switch the partition table