KaiGai, * KaiGai Kohei (kai...@ak.jp.nec.com) wrote: > The attached patch is proof of the concept.
Thanks! > It can be applied on the latest CVS HEAD with colprivs_2009011001.diff.gz. > - It unpatches unnecessary updates at parser/parse_expr.c, parser/parse_node.c > and parser/parse_relation.c. > - It adds markColumnForSelectPriv() to mark proper rte->cols_sel for > the given Var node. It is invoked from scanRTEForColumn(), expandRelAttrs() > and transformWholeRowRef(). Ok. > - The markColumnForSelectPriv() uses walker function internally, because > there is no guarantee all the entities within RangeTblEntry->joinaliasvars > are Var type node. However, it is used to walks on a single Var node, not > whole of Query tree, so I think its cost is small enough. If any of them aren't Vars, then wouldn't it be a subselect or similar, in which case the non-join pieces would be handled through scanRTEForColumn, etc? What I'm getting at here is- Are you sure that the walk down the non-Var's in joinaliasvars is necessary? Have you tried testing without it? Other comments- you dropped the comments I had regarding the offsetting when using the bitmap, and it would really be helpful if you could add these cases to the regression tests so that myself and others working on this patch and the code involved make sure to not break the semantics which are required. Thnaks! Stephen
signature.asc
Description: Digital signature