1212 * IDENTIFICATION
1313 * src/backend/executor/nodeRecjoin.c
1414 *
15+ * THIS CODE IS CURRENTLY NOT INCORPORATED IN RECDB.
16+ *
1517 *-------------------------------------------------------------------------
1618 */
1719/*
@@ -114,7 +116,7 @@ ExecRecJoin(RecJoinState *recjoin)
114116 * until we're done projecting out tuples from a join tuple.
115117 */
116118 ResetExprContext (econtext );
117- printf ( "RecJoin.\n" );
119+
118120 /*
119121 * Ok, everything is setup for the join. We're going to get exactly one
120122 * tuple from the outer plan, because we just want to use its tupleDesc
@@ -131,23 +133,21 @@ printf("RecJoin.\n");
131133 int i , userID , innerItemID , natts ;
132134 GenRating * findRating ;
133135 bool minimalTuple = false;
134- printf ( "Point 1.\n" );
136+
135137 /*
136138 * If we need an outer tuple, we fetch one. This creates a few
137139 * structures that we need to effectively perform a RecJoin.
138140 * It works both for initializing and resuming the inner loop.
139141 */
140142 if (recjoin -> rj_NeedNewOuter ) {
141143 GenRating * tempItem ;
142- printf ("Point 2.\n" );
143144
144145 outerTupleSlot = ExecProcNode (outerPlan );
145146 /* If this happens, we're out of users. */
146147 if (TupIsNull (outerTupleSlot )) {
147148 ENL1_printf ("no outer tuple (out of users), ending join" );
148149 return NULL ;
149150 }
150- printf ("Point 3.\n" );
151151
152152 /* Otherwise, we need to construct our hash table, since
153153 * we need info from the previous operator to do so. */
@@ -163,20 +163,17 @@ printf("Point 3.\n");
163163
164164 hashAdd (recjoin -> itemTable ,tempItem );
165165 }
166- printf ("Point 4.\n" );
167166
168167 /* Then we'll do some other stuff to ensure the loop
169168 * runs correctly. */
170169 recjoin -> rj_NeedNewOuter = false;
171170 ENL1_printf ("rescanning inner plan" );
172171 ExecReScan (innerPlan );
173172 }
174- printf ("Point 5.\n" );
175173
176174 /* We construct a new tuple on the fly. */
177175 outerTupleSlot = MakeSingleTupleTableSlot (recnode -> base_slot );
178176 outerTupleSlot -> tts_isempty = false;
179- printf ("Point 6.\n" );
180177
181178 /* Mark all slots as non-empty and zero. */
182179 natts = outerTupleSlot -> tts_tupleDescriptor -> natts ;
@@ -186,7 +183,6 @@ printf("Point 6.\n");
186183 outerTupleSlot -> tts_isnull [i ] = false;
187184 outerTupleSlot -> tts_nvalid ++ ;
188185 }
189- printf ("Point 7.\n" );
190186
191187 /*
192188 * try to get the next inner tuple.
@@ -202,17 +198,16 @@ printf("Point 7.\n");
202198 if (recjoin -> innerTupleAtt < 0 ) {
203199 for (i = 0 ; i < innerTupleSlot -> tts_tupleDescriptor -> natts ; i ++ ) {
204200 char * col_name = innerTupleSlot -> tts_tupleDescriptor -> attrs [i ]-> attname .data ;
205- //printf("%s\n",col_name);
201+
206202 if (strcmp (col_name ,attributes -> itemkey ) == 0 ) {
207203 recjoin -> innerTupleAtt = i ;
208204 break ;
209205 }
210206 }
211207 }
212- printf ( "Point 7.5.\n" );
208+
213209 if (!TupIsNull (innerTupleSlot ) && innerTupleSlot -> tts_mintuple )
214210 minimalTuple = true;
215- printf ("Point 8.\n" );
216211
217212 /* If there's no inner tuple, then we'll make a note to reset the
218213 * inner loop and get a new outer tuple. */
@@ -222,7 +217,6 @@ printf("Point 8.\n");
222217 recjoin -> rj_NeedNewOuter = true;
223218 continue ;
224219 }
225- printf ("Point 9.\n" );
226220
227221 /*
228222 * We now have an inner tuple and a shell of an outer tuple. We need
@@ -247,18 +241,12 @@ printf("Point 9.\n");
247241 FreeTupleDesc(tempdesc);*/
248242 }
249243 userID = attributes -> userID ;
250- printf ("Point 10.\n" );
251244
252245 /*
253246 * Is this item ID one of the ones we need to predict a rating for?
254247 */
255- if (!recjoin -> itemTable ) printf ("No table.\n" );
256- printf ("innerItemID = %d\n" ,innerItemID );
257- printf ("userID = %d\n" ,userID );
258- if (innerItemID < 0 ) {printf ("Skipping item.\n" );continue ;}
259248 findRating = hashFind (recjoin -> itemTable ,innerItemID );
260249 if (!findRating ) continue ;
261- printf ("Point 11.\n" );
262250
263251 /*
264252 * We're ok to construct a tuple at this point.
@@ -269,7 +257,6 @@ printf("Point 11.\n");
269257 outerTupleSlot -> tts_isnull [recnode -> itematt ] = false;
270258
271259 econtext -> ecxt_outertuple = outerTupleSlot ;
272- printf ("Point 12.\n" );
273260
274261 /*
275262 * at this point we have a new pair of inner and outer tuples so we
@@ -284,23 +271,20 @@ printf("Point 12.\n");
284271 if (ExecQual (joinqual , econtext , false))
285272 {
286273 node -> nl_MatchedOuter = true;
287- printf ("Point 13.\n" );
288274
289275 /* In an antijoin, we never return a matched tuple */
290276 if (node -> js .jointype == JOIN_ANTI )
291277 {
292278 node -> nl_NeedNewOuter = true;
293279 continue ; /* return to top of loop */
294280 }
295- printf ("Point 14.\n" );
296281
297282 /*
298283 * In a semijoin, we'll consider returning the first match, but
299284 * after that we're done with this outer tuple.
300285 */
301286 if (node -> js .jointype == JOIN_SEMI )
302287 node -> nl_NeedNewOuter = true;
303- printf ("Point 15.\n" );
304288
305289 if (otherqual == NIL || ExecQual (otherqual , econtext , false))
306290 {
@@ -310,7 +294,6 @@ printf("Point 15.\n");
310294 */
311295 TupleTableSlot * result ;
312296 ExprDoneCond isDone ;
313- printf ("Point 16.\n" );
314297
315298 /*
316299 * The tuples match our qualifications. We now apply
@@ -319,12 +302,10 @@ printf("Point 16.\n");
319302 */
320303 int itemindex = binarySearch (recnode -> fullItemList , innerItemID , 0 , recnode -> fullTotalItems );
321304 applyRecScore (recnode , outerTupleSlot , innerItemID , itemindex );
322- printf ("Point 17.\n" );
323305
324306 ENL1_printf ("qualification succeeded, projecting tuple" );
325307
326308 result = ExecProject (node -> js .ps .ps_ProjInfo , & isDone );
327- printf ("Point 18.\n" );
328309
329310 if (isDone != ExprEndResult )
330311 {
@@ -343,7 +324,6 @@ printf("Point 18.\n");
343324 * Tuple fails qual, so free per-tuple memory and try again.
344325 */
345326 ResetExprContext (econtext );
346- printf ("Point 19.\n" );
347327
348328 ENL1_printf ("qualification failed, looping" );
349329 }
@@ -356,8 +336,6 @@ printf("Point 19.\n");
356336RecJoinState *
357337ExecInitRecJoin (RecJoin * node , EState * estate , int eflags )
358338{
359- int i ;
360- GenRating * tempItem ;
361339 RecJoinState * rjstate ;
362340
363341 rjstate = makeNode (RecJoinState );
0 commit comments