OSDN Git Service

Support DECLARE CURSOR syntax and added regression for table hinting.
[pghintplan/pg_hint_plan.git] / expected / ut-G.out
1 LOAD 'pg_hint_plan';
2 SET pg_hint_plan.enable_hint TO on;
3 SET pg_hint_plan.debug_print TO on;
4 SET client_min_messages TO LOG;
5 SET search_path TO public;
6 ----
7 ---- No. G-1-1 RULE definition table
8 ----
9 -- No. G-1-1-1
10 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
11                            QUERY PLAN                            
12 -----------------------------------------------------------------
13  Aggregate
14    ->  Nested Loop
15          Join Filter: (t1.c1 = t4.c1)
16          ->  Tid Scan on t4
17                TID Cond: (ctid = '(1,1)'::tid)
18          ->  Nested Loop
19                Join Filter: (t1.c1 = t3.c1)
20                ->  Tid Scan on t3
21                      TID Cond: (ctid = '(1,1)'::tid)
22                ->  Nested Loop
23                      Join Filter: (t1.c1 = t2.c1)
24                      ->  Seq Scan on t2
25                            Filter: (ctid = '(1,1)'::tid)
26                      ->  Nested Loop
27                            ->  Tid Scan on r1
28                                  TID Cond: (ctid = '(1,1)'::tid)
29                                  Filter: (c1 = 1)
30                            ->  Tid Scan on t1
31                                  TID Cond: (ctid = '(1,1)'::tid)
32 (19 rows)
33
34 /*+
35 Set(enable_tidscan off)Set(enable_nestloop off)
36 */
37 EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
38 LOG:  pg_hint_plan:
39 used hint:
40 Set(enable_nestloop off)
41 Set(enable_tidscan off)
42 not used hint:
43 duplication hint:
44 error hint:
45
46                              QUERY PLAN                              
47 ---------------------------------------------------------------------
48  Aggregate
49    ->  Nested Loop
50          ->  Hash Join
51                Hash Cond: (t1.c1 = t4.c1)
52                ->  Hash Join
53                      Hash Cond: (t1.c1 = t2.c1)
54                      ->  Hash Join
55                            Hash Cond: (t3.c1 = t1.c1)
56                            ->  Seq Scan on t3
57                                  Filter: (ctid = '(1,1)'::tid)
58                            ->  Hash
59                                  ->  Seq Scan on t1
60                                        Filter: (ctid = '(1,1)'::tid)
61                      ->  Hash
62                            ->  Seq Scan on t2
63                                  Filter: (ctid = '(1,1)'::tid)
64                ->  Hash
65                      ->  Seq Scan on t4
66                            Filter: (ctid = '(1,1)'::tid)
67          ->  Seq Scan on r1
68                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
69 (21 rows)
70
71 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
72                            QUERY PLAN                            
73 -----------------------------------------------------------------
74  Aggregate
75    ->  Nested Loop
76          Join Filter: (b1t1.c1 = b1t4.c1)
77          ->  Tid Scan on t4 b1t4
78                TID Cond: (ctid = '(1,1)'::tid)
79          ->  Nested Loop
80                Join Filter: (b1t1.c1 = b1t3.c1)
81                ->  Tid Scan on t3 b1t3
82                      TID Cond: (ctid = '(1,1)'::tid)
83                ->  Nested Loop
84                      Join Filter: (b1t1.c1 = b1t2.c1)
85                      ->  Seq Scan on t2 b1t2
86                            Filter: (ctid = '(1,1)'::tid)
87                      ->  Nested Loop
88                            ->  Tid Scan on r1_
89                                  TID Cond: (ctid = '(1,1)'::tid)
90                                  Filter: (c1 = 1)
91                            ->  Tid Scan on t1 b1t1
92                                  TID Cond: (ctid = '(1,1)'::tid)
93 (19 rows)
94
95 /*+
96 Set(enable_tidscan off)Set(enable_nestloop off)
97 */
98 EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
99 LOG:  pg_hint_plan:
100 used hint:
101 Set(enable_nestloop off)
102 Set(enable_tidscan off)
103 not used hint:
104 duplication hint:
105 error hint:
106
107                              QUERY PLAN                              
108 ---------------------------------------------------------------------
109  Aggregate
110    ->  Nested Loop
111          ->  Hash Join
112                Hash Cond: (b1t1.c1 = b1t4.c1)
113                ->  Hash Join
114                      Hash Cond: (b1t1.c1 = b1t2.c1)
115                      ->  Hash Join
116                            Hash Cond: (b1t3.c1 = b1t1.c1)
117                            ->  Seq Scan on t3 b1t3
118                                  Filter: (ctid = '(1,1)'::tid)
119                            ->  Hash
120                                  ->  Seq Scan on t1 b1t1
121                                        Filter: (ctid = '(1,1)'::tid)
122                      ->  Hash
123                            ->  Seq Scan on t2 b1t2
124                                  Filter: (ctid = '(1,1)'::tid)
125                ->  Hash
126                      ->  Seq Scan on t4 b1t4
127                            Filter: (ctid = '(1,1)'::tid)
128          ->  Seq Scan on r1_
129                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
130 (21 rows)
131
132 -- No. G-1-1-2
133 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
134                            QUERY PLAN                            
135 -----------------------------------------------------------------
136  Aggregate
137    ->  Nested Loop
138          Join Filter: (t1.c1 = t4.c1)
139          ->  Tid Scan on t4
140                TID Cond: (ctid = '(1,1)'::tid)
141          ->  Nested Loop
142                Join Filter: (t1.c1 = t3.c1)
143                ->  Tid Scan on t3
144                      TID Cond: (ctid = '(1,1)'::tid)
145                ->  Nested Loop
146                      Join Filter: (t1.c1 = t2.c1)
147                      ->  Seq Scan on t2
148                            Filter: (ctid = '(1,1)'::tid)
149                      ->  Nested Loop
150                            ->  Tid Scan on r2
151                                  TID Cond: (ctid = '(1,1)'::tid)
152                                  Filter: (c1 = 1)
153                            ->  Tid Scan on t1
154                                  TID Cond: (ctid = '(1,1)'::tid)
155  
156  Aggregate
157    ->  Nested Loop
158          Join Filter: (t1.c1 = t4.c1)
159          ->  Tid Scan on t4
160                TID Cond: (ctid = '(1,1)'::tid)
161          ->  Nested Loop
162                Join Filter: (t1.c1 = t3.c1)
163                ->  Tid Scan on t3
164                      TID Cond: (ctid = '(1,1)'::tid)
165                ->  Nested Loop
166                      Join Filter: (t1.c1 = t2.c1)
167                      ->  Seq Scan on t2
168                            Filter: (ctid = '(1,1)'::tid)
169                      ->  Nested Loop
170                            ->  Tid Scan on r2
171                                  TID Cond: (ctid = '(1,1)'::tid)
172                                  Filter: (c1 = 1)
173                            ->  Tid Scan on t1
174                                  TID Cond: (ctid = '(1,1)'::tid)
175 (39 rows)
176
177 /*+
178 Set(enable_tidscan off)Set(enable_nestloop off)
179 */
180 EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
181 LOG:  pg_hint_plan:
182 used hint:
183 Set(enable_nestloop off)
184 Set(enable_tidscan off)
185 not used hint:
186 duplication hint:
187 error hint:
188
189 LOG:  pg_hint_plan:
190 used hint:
191 Set(enable_nestloop off)
192 Set(enable_tidscan off)
193 not used hint:
194 duplication hint:
195 error hint:
196
197                              QUERY PLAN                              
198 ---------------------------------------------------------------------
199  Aggregate
200    ->  Nested Loop
201          ->  Hash Join
202                Hash Cond: (t1.c1 = t4.c1)
203                ->  Hash Join
204                      Hash Cond: (t1.c1 = t2.c1)
205                      ->  Hash Join
206                            Hash Cond: (t3.c1 = t1.c1)
207                            ->  Seq Scan on t3
208                                  Filter: (ctid = '(1,1)'::tid)
209                            ->  Hash
210                                  ->  Seq Scan on t1
211                                        Filter: (ctid = '(1,1)'::tid)
212                      ->  Hash
213                            ->  Seq Scan on t2
214                                  Filter: (ctid = '(1,1)'::tid)
215                ->  Hash
216                      ->  Seq Scan on t4
217                            Filter: (ctid = '(1,1)'::tid)
218          ->  Seq Scan on r2
219                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
220  
221  Aggregate
222    ->  Nested Loop
223          ->  Hash Join
224                Hash Cond: (t1.c1 = t4.c1)
225                ->  Hash Join
226                      Hash Cond: (t1.c1 = t2.c1)
227                      ->  Hash Join
228                            Hash Cond: (t3.c1 = t1.c1)
229                            ->  Seq Scan on t3
230                                  Filter: (ctid = '(1,1)'::tid)
231                            ->  Hash
232                                  ->  Seq Scan on t1
233                                        Filter: (ctid = '(1,1)'::tid)
234                      ->  Hash
235                            ->  Seq Scan on t2
236                                  Filter: (ctid = '(1,1)'::tid)
237                ->  Hash
238                      ->  Seq Scan on t4
239                            Filter: (ctid = '(1,1)'::tid)
240          ->  Seq Scan on r2
241                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
242 (43 rows)
243
244 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
245                            QUERY PLAN                            
246 -----------------------------------------------------------------
247  Aggregate
248    ->  Nested Loop
249          Join Filter: (b1t1.c1 = b1t4.c1)
250          ->  Tid Scan on t4 b1t4
251                TID Cond: (ctid = '(1,1)'::tid)
252          ->  Nested Loop
253                Join Filter: (b1t1.c1 = b1t3.c1)
254                ->  Tid Scan on t3 b1t3
255                      TID Cond: (ctid = '(1,1)'::tid)
256                ->  Nested Loop
257                      Join Filter: (b1t1.c1 = b1t2.c1)
258                      ->  Seq Scan on t2 b1t2
259                            Filter: (ctid = '(1,1)'::tid)
260                      ->  Nested Loop
261                            ->  Tid Scan on r2_
262                                  TID Cond: (ctid = '(1,1)'::tid)
263                                  Filter: (c1 = 1)
264                            ->  Tid Scan on t1 b1t1
265                                  TID Cond: (ctid = '(1,1)'::tid)
266  
267  Aggregate
268    ->  Nested Loop
269          Join Filter: (b2t1.c1 = b2t4.c1)
270          ->  Tid Scan on t4 b2t4
271                TID Cond: (ctid = '(1,1)'::tid)
272          ->  Nested Loop
273                Join Filter: (b2t1.c1 = b2t3.c1)
274                ->  Tid Scan on t3 b2t3
275                      TID Cond: (ctid = '(1,1)'::tid)
276                ->  Nested Loop
277                      Join Filter: (b2t1.c1 = b2t2.c1)
278                      ->  Seq Scan on t2 b2t2
279                            Filter: (ctid = '(1,1)'::tid)
280                      ->  Nested Loop
281                            ->  Tid Scan on r2_
282                                  TID Cond: (ctid = '(1,1)'::tid)
283                                  Filter: (c1 = 1)
284                            ->  Tid Scan on t1 b2t1
285                                  TID Cond: (ctid = '(1,1)'::tid)
286 (39 rows)
287
288 /*+
289 Set(enable_tidscan off)Set(enable_nestloop off)
290 */
291 EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
292 LOG:  pg_hint_plan:
293 used hint:
294 Set(enable_nestloop off)
295 Set(enable_tidscan off)
296 not used hint:
297 duplication hint:
298 error hint:
299
300 LOG:  pg_hint_plan:
301 used hint:
302 Set(enable_nestloop off)
303 Set(enable_tidscan off)
304 not used hint:
305 duplication hint:
306 error hint:
307
308                              QUERY PLAN                              
309 ---------------------------------------------------------------------
310  Aggregate
311    ->  Nested Loop
312          ->  Hash Join
313                Hash Cond: (b1t1.c1 = b1t4.c1)
314                ->  Hash Join
315                      Hash Cond: (b1t1.c1 = b1t2.c1)
316                      ->  Hash Join
317                            Hash Cond: (b1t3.c1 = b1t1.c1)
318                            ->  Seq Scan on t3 b1t3
319                                  Filter: (ctid = '(1,1)'::tid)
320                            ->  Hash
321                                  ->  Seq Scan on t1 b1t1
322                                        Filter: (ctid = '(1,1)'::tid)
323                      ->  Hash
324                            ->  Seq Scan on t2 b1t2
325                                  Filter: (ctid = '(1,1)'::tid)
326                ->  Hash
327                      ->  Seq Scan on t4 b1t4
328                            Filter: (ctid = '(1,1)'::tid)
329          ->  Seq Scan on r2_
330                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
331  
332  Aggregate
333    ->  Nested Loop
334          ->  Hash Join
335                Hash Cond: (b2t1.c1 = b2t4.c1)
336                ->  Hash Join
337                      Hash Cond: (b2t1.c1 = b2t2.c1)
338                      ->  Hash Join
339                            Hash Cond: (b2t3.c1 = b2t1.c1)
340                            ->  Seq Scan on t3 b2t3
341                                  Filter: (ctid = '(1,1)'::tid)
342                            ->  Hash
343                                  ->  Seq Scan on t1 b2t1
344                                        Filter: (ctid = '(1,1)'::tid)
345                      ->  Hash
346                            ->  Seq Scan on t2 b2t2
347                                  Filter: (ctid = '(1,1)'::tid)
348                ->  Hash
349                      ->  Seq Scan on t4 b2t4
350                            Filter: (ctid = '(1,1)'::tid)
351          ->  Seq Scan on r2_
352                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
353 (43 rows)
354
355 -- No. G-1-1-3
356 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
357                            QUERY PLAN                            
358 -----------------------------------------------------------------
359  Aggregate
360    ->  Nested Loop
361          Join Filter: (t1.c1 = t4.c1)
362          ->  Tid Scan on t4
363                TID Cond: (ctid = '(1,1)'::tid)
364          ->  Nested Loop
365                Join Filter: (t1.c1 = t3.c1)
366                ->  Tid Scan on t3
367                      TID Cond: (ctid = '(1,1)'::tid)
368                ->  Nested Loop
369                      Join Filter: (t1.c1 = t2.c1)
370                      ->  Seq Scan on t2
371                            Filter: (ctid = '(1,1)'::tid)
372                      ->  Nested Loop
373                            ->  Tid Scan on r3
374                                  TID Cond: (ctid = '(1,1)'::tid)
375                                  Filter: (c1 = 1)
376                            ->  Tid Scan on t1
377                                  TID Cond: (ctid = '(1,1)'::tid)
378  
379  Aggregate
380    ->  Nested Loop
381          Join Filter: (t1.c1 = t4.c1)
382          ->  Tid Scan on t4
383                TID Cond: (ctid = '(1,1)'::tid)
384          ->  Nested Loop
385                Join Filter: (t1.c1 = t3.c1)
386                ->  Tid Scan on t3
387                      TID Cond: (ctid = '(1,1)'::tid)
388                ->  Nested Loop
389                      Join Filter: (t1.c1 = t2.c1)
390                      ->  Seq Scan on t2
391                            Filter: (ctid = '(1,1)'::tid)
392                      ->  Nested Loop
393                            ->  Tid Scan on r3
394                                  TID Cond: (ctid = '(1,1)'::tid)
395                                  Filter: (c1 = 1)
396                            ->  Tid Scan on t1
397                                  TID Cond: (ctid = '(1,1)'::tid)
398  
399  Aggregate
400    ->  Nested Loop
401          Join Filter: (t1.c1 = t4.c1)
402          ->  Tid Scan on t4
403                TID Cond: (ctid = '(1,1)'::tid)
404          ->  Nested Loop
405                Join Filter: (t1.c1 = t3.c1)
406                ->  Tid Scan on t3
407                      TID Cond: (ctid = '(1,1)'::tid)
408                ->  Nested Loop
409                      Join Filter: (t1.c1 = t2.c1)
410                      ->  Seq Scan on t2
411                            Filter: (ctid = '(1,1)'::tid)
412                      ->  Nested Loop
413                            ->  Tid Scan on r3
414                                  TID Cond: (ctid = '(1,1)'::tid)
415                                  Filter: (c1 = 1)
416                            ->  Tid Scan on t1
417                                  TID Cond: (ctid = '(1,1)'::tid)
418 (59 rows)
419
420 /*+
421 Set(enable_tidscan off)Set(enable_nestloop off)
422 */
423 EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
424 LOG:  pg_hint_plan:
425 used hint:
426 Set(enable_nestloop off)
427 Set(enable_tidscan off)
428 not used hint:
429 duplication hint:
430 error hint:
431
432 LOG:  pg_hint_plan:
433 used hint:
434 Set(enable_nestloop off)
435 Set(enable_tidscan off)
436 not used hint:
437 duplication hint:
438 error hint:
439
440 LOG:  pg_hint_plan:
441 used hint:
442 Set(enable_nestloop off)
443 Set(enable_tidscan off)
444 not used hint:
445 duplication hint:
446 error hint:
447
448                              QUERY PLAN                              
449 ---------------------------------------------------------------------
450  Aggregate
451    ->  Nested Loop
452          ->  Hash Join
453                Hash Cond: (t1.c1 = t4.c1)
454                ->  Hash Join
455                      Hash Cond: (t1.c1 = t2.c1)
456                      ->  Hash Join
457                            Hash Cond: (t3.c1 = t1.c1)
458                            ->  Seq Scan on t3
459                                  Filter: (ctid = '(1,1)'::tid)
460                            ->  Hash
461                                  ->  Seq Scan on t1
462                                        Filter: (ctid = '(1,1)'::tid)
463                      ->  Hash
464                            ->  Seq Scan on t2
465                                  Filter: (ctid = '(1,1)'::tid)
466                ->  Hash
467                      ->  Seq Scan on t4
468                            Filter: (ctid = '(1,1)'::tid)
469          ->  Seq Scan on r3
470                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
471  
472  Aggregate
473    ->  Nested Loop
474          ->  Hash Join
475                Hash Cond: (t1.c1 = t4.c1)
476                ->  Hash Join
477                      Hash Cond: (t1.c1 = t2.c1)
478                      ->  Hash Join
479                            Hash Cond: (t3.c1 = t1.c1)
480                            ->  Seq Scan on t3
481                                  Filter: (ctid = '(1,1)'::tid)
482                            ->  Hash
483                                  ->  Seq Scan on t1
484                                        Filter: (ctid = '(1,1)'::tid)
485                      ->  Hash
486                            ->  Seq Scan on t2
487                                  Filter: (ctid = '(1,1)'::tid)
488                ->  Hash
489                      ->  Seq Scan on t4
490                            Filter: (ctid = '(1,1)'::tid)
491          ->  Seq Scan on r3
492                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
493  
494  Aggregate
495    ->  Nested Loop
496          ->  Hash Join
497                Hash Cond: (t1.c1 = t4.c1)
498                ->  Hash Join
499                      Hash Cond: (t1.c1 = t2.c1)
500                      ->  Hash Join
501                            Hash Cond: (t3.c1 = t1.c1)
502                            ->  Seq Scan on t3
503                                  Filter: (ctid = '(1,1)'::tid)
504                            ->  Hash
505                                  ->  Seq Scan on t1
506                                        Filter: (ctid = '(1,1)'::tid)
507                      ->  Hash
508                            ->  Seq Scan on t2
509                                  Filter: (ctid = '(1,1)'::tid)
510                ->  Hash
511                      ->  Seq Scan on t4
512                            Filter: (ctid = '(1,1)'::tid)
513          ->  Seq Scan on r3
514                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
515 (65 rows)
516
517 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
518                            QUERY PLAN                            
519 -----------------------------------------------------------------
520  Aggregate
521    ->  Nested Loop
522          Join Filter: (b1t1.c1 = b1t4.c1)
523          ->  Tid Scan on t4 b1t4
524                TID Cond: (ctid = '(1,1)'::tid)
525          ->  Nested Loop
526                Join Filter: (b1t1.c1 = b1t3.c1)
527                ->  Tid Scan on t3 b1t3
528                      TID Cond: (ctid = '(1,1)'::tid)
529                ->  Nested Loop
530                      Join Filter: (b1t1.c1 = b1t2.c1)
531                      ->  Seq Scan on t2 b1t2
532                            Filter: (ctid = '(1,1)'::tid)
533                      ->  Nested Loop
534                            ->  Tid Scan on r3_
535                                  TID Cond: (ctid = '(1,1)'::tid)
536                                  Filter: (c1 = 1)
537                            ->  Tid Scan on t1 b1t1
538                                  TID Cond: (ctid = '(1,1)'::tid)
539  
540  Aggregate
541    ->  Nested Loop
542          Join Filter: (b2t1.c1 = b2t4.c1)
543          ->  Tid Scan on t4 b2t4
544                TID Cond: (ctid = '(1,1)'::tid)
545          ->  Nested Loop
546                Join Filter: (b2t1.c1 = b2t3.c1)
547                ->  Tid Scan on t3 b2t3
548                      TID Cond: (ctid = '(1,1)'::tid)
549                ->  Nested Loop
550                      Join Filter: (b2t1.c1 = b2t2.c1)
551                      ->  Seq Scan on t2 b2t2
552                            Filter: (ctid = '(1,1)'::tid)
553                      ->  Nested Loop
554                            ->  Tid Scan on r3_
555                                  TID Cond: (ctid = '(1,1)'::tid)
556                                  Filter: (c1 = 1)
557                            ->  Tid Scan on t1 b2t1
558                                  TID Cond: (ctid = '(1,1)'::tid)
559  
560  Aggregate
561    ->  Nested Loop
562          Join Filter: (b3t1.c1 = b3t4.c1)
563          ->  Tid Scan on t4 b3t4
564                TID Cond: (ctid = '(1,1)'::tid)
565          ->  Nested Loop
566                Join Filter: (b3t1.c1 = b3t3.c1)
567                ->  Tid Scan on t3 b3t3
568                      TID Cond: (ctid = '(1,1)'::tid)
569                ->  Nested Loop
570                      Join Filter: (b3t1.c1 = b3t2.c1)
571                      ->  Seq Scan on t2 b3t2
572                            Filter: (ctid = '(1,1)'::tid)
573                      ->  Nested Loop
574                            ->  Tid Scan on r3_
575                                  TID Cond: (ctid = '(1,1)'::tid)
576                                  Filter: (c1 = 1)
577                            ->  Tid Scan on t1 b3t1
578                                  TID Cond: (ctid = '(1,1)'::tid)
579 (59 rows)
580
581 /*+
582 Set(enable_tidscan off)Set(enable_nestloop off)
583 */
584 EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
585 LOG:  pg_hint_plan:
586 used hint:
587 Set(enable_nestloop off)
588 Set(enable_tidscan off)
589 not used hint:
590 duplication hint:
591 error hint:
592
593 LOG:  pg_hint_plan:
594 used hint:
595 Set(enable_nestloop off)
596 Set(enable_tidscan off)
597 not used hint:
598 duplication hint:
599 error hint:
600
601 LOG:  pg_hint_plan:
602 used hint:
603 Set(enable_nestloop off)
604 Set(enable_tidscan off)
605 not used hint:
606 duplication hint:
607 error hint:
608
609                              QUERY PLAN                              
610 ---------------------------------------------------------------------
611  Aggregate
612    ->  Nested Loop
613          ->  Hash Join
614                Hash Cond: (b1t1.c1 = b1t4.c1)
615                ->  Hash Join
616                      Hash Cond: (b1t1.c1 = b1t2.c1)
617                      ->  Hash Join
618                            Hash Cond: (b1t3.c1 = b1t1.c1)
619                            ->  Seq Scan on t3 b1t3
620                                  Filter: (ctid = '(1,1)'::tid)
621                            ->  Hash
622                                  ->  Seq Scan on t1 b1t1
623                                        Filter: (ctid = '(1,1)'::tid)
624                      ->  Hash
625                            ->  Seq Scan on t2 b1t2
626                                  Filter: (ctid = '(1,1)'::tid)
627                ->  Hash
628                      ->  Seq Scan on t4 b1t4
629                            Filter: (ctid = '(1,1)'::tid)
630          ->  Seq Scan on r3_
631                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
632  
633  Aggregate
634    ->  Nested Loop
635          ->  Hash Join
636                Hash Cond: (b2t1.c1 = b2t4.c1)
637                ->  Hash Join
638                      Hash Cond: (b2t1.c1 = b2t2.c1)
639                      ->  Hash Join
640                            Hash Cond: (b2t3.c1 = b2t1.c1)
641                            ->  Seq Scan on t3 b2t3
642                                  Filter: (ctid = '(1,1)'::tid)
643                            ->  Hash
644                                  ->  Seq Scan on t1 b2t1
645                                        Filter: (ctid = '(1,1)'::tid)
646                      ->  Hash
647                            ->  Seq Scan on t2 b2t2
648                                  Filter: (ctid = '(1,1)'::tid)
649                ->  Hash
650                      ->  Seq Scan on t4 b2t4
651                            Filter: (ctid = '(1,1)'::tid)
652          ->  Seq Scan on r3_
653                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
654  
655  Aggregate
656    ->  Nested Loop
657          ->  Hash Join
658                Hash Cond: (b3t1.c1 = b3t4.c1)
659                ->  Hash Join
660                      Hash Cond: (b3t1.c1 = b3t2.c1)
661                      ->  Hash Join
662                            Hash Cond: (b3t3.c1 = b3t1.c1)
663                            ->  Seq Scan on t3 b3t3
664                                  Filter: (ctid = '(1,1)'::tid)
665                            ->  Hash
666                                  ->  Seq Scan on t1 b3t1
667                                        Filter: (ctid = '(1,1)'::tid)
668                      ->  Hash
669                            ->  Seq Scan on t2 b3t2
670                                  Filter: (ctid = '(1,1)'::tid)
671                ->  Hash
672                      ->  Seq Scan on t4 b3t4
673                            Filter: (ctid = '(1,1)'::tid)
674          ->  Seq Scan on r3_
675                Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1))
676 (65 rows)
677
678 RESET client_min_messages;
679 ----
680 ---- No. G-2-1 GUC parameter
681 ----
682 -- No. G-2-1-3
683 /*+Set(1234567890123456789012345678901234567890123456789012345678901234 1)*/
684 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
685 NOTICE:  identifier "1234567890123456789012345678901234567890123456789012345678901234" will be truncated to "123456789012345678901234567890123456789012345678901234567890123"
686 INFO:  unrecognized configuration parameter "123456789012345678901234567890123456789012345678901234567890123"
687  c1 | c2 | c3 | c4 
688 ----+----+----+----
689   1 |  1 |  1 | 1
690 (1 row)
691
692 -- No. G-2-1-4
693 /*+Set(constraint_exclusion 1234567890123456789012345678901234567890123456789012345678901234)*/
694 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
695 INFO:  invalid value for parameter "constraint_exclusion": "1234567890123456789012345678901234567890123456789012345678901234"
696 HINT:  Available values: partition, on, off.
697  c1 | c2 | c3 | c4 
698 ----+----+----+----
699   1 |  1 |  1 | 1
700 (1 row)
701
702 ----
703 ---- No. G-2-2 category of GUC parameter and role
704 ----
705 -- No. G-2-2-1
706 SET ROLE super_user;
707 /*+Set(block_size 16384)*/
708 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
709 INFO:  parameter "block_size" cannot be changed
710  c1 | c2 | c3 | c4 
711 ----+----+----+----
712   1 |  1 |  1 | 1
713 (1 row)
714
715 -- No. G-2-2-2
716 /*+Set(archive_mode off)*/
717 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
718 INFO:  parameter "archive_mode" cannot be changed without restarting the server
719  c1 | c2 | c3 | c4 
720 ----+----+----+----
721   1 |  1 |  1 | 1
722 (1 row)
723
724 -- No. G-2-2-3
725 /*+Set(archive_timeout 0)*/
726 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
727 INFO:  parameter "archive_timeout" cannot be changed now
728  c1 | c2 | c3 | c4 
729 ----+----+----+----
730   1 |  1 |  1 | 1
731 (1 row)
732
733 -- No. G-2-2-4
734 /*+Set(log_connections off)*/
735 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
736 INFO:  parameter "log_connections" cannot be set after connection start
737  c1 | c2 | c3 | c4 
738 ----+----+----+----
739   1 |  1 |  1 | 1
740 (1 row)
741
742 -- No. G-2-2-5
743 /*+Set(log_min_messages WARNING)*/
744 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
745  c1 | c2 | c3 | c4 
746 ----+----+----+----
747   1 |  1 |  1 | 1
748 (1 row)
749
750 RESET ROLE;
751 -- No. G-2-2-6
752 GRANT ALL ON SCHEMA s1 TO PUBLIC;
753 GRANT SELECT ON ALL TABLES IN SCHEMA s1 TO normal_user;
754 SET ROLE normal_user;
755 /*+Set(log_min_messages WARNING)*/
756 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
757 INFO:  permission denied to set parameter "log_min_messages"
758  c1 | c2 | c3 | c4 
759 ----+----+----+----
760   1 |  1 |  1 | 1
761 (1 row)
762
763 -- No. G-2-2-7
764 /*+Set(enable_seqscan on)*/
765 SELECT * FROM s1.t1 WHERE t1.c1 = 1;
766  c1 | c2 | c3 | c4 
767 ----+----+----+----
768   1 |  1 |  1 | 1
769 (1 row)
770
771 RESET ROLE;
772 REVOKE SELECT ON ALL TABLES IN SCHEMA s1 FROM normal_user;
773 REVOKE ALL ON SCHEMA s1 FROM PUBLIC;
774 ----
775 ---- No. G-2-3 conflict set hint
776 ----
777 SET client_min_messages TO LOG;
778 -- No. G-2-3-1
779 /*+Set(enable_indexscan on)Set(enable_indexscan off)*/
780 SELECT * FROM s1.t1 WHERE false;
781 INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan off)"
782 DETAIL:  Conflict set hint.
783 LOG:  pg_hint_plan:
784 used hint:
785 Set(enable_indexscan off)
786 not used hint:
787 duplication hint:
788 Set(enable_indexscan on)
789 error hint:
790
791  c1 | c2 | c3 | c4 
792 ----+----+----+----
793 (0 rows)
794
795 -- No. G-2-3-2
796 /*+Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)*/
797 SELECT * FROM s1.t1 WHERE false;
798 INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
799 DETAIL:  Conflict set hint.
800 INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
801 DETAIL:  Conflict set hint.
802 LOG:  pg_hint_plan:
803 used hint:
804 Set(client_min_messages DEBUG2)
805 not used hint:
806 duplication hint:
807 Set(client_min_messages DEBUG5)
808 Set(client_min_messages WARNING)
809 error hint:
810
811  c1 | c2 | c3 | c4 
812 ----+----+----+----
813 (0 rows)
814
815 -- No. G-2-3-3
816 /*+Set(enable_indexscan on)Set(enable_indexscan o)*/
817 SELECT * FROM s1.t1 WHERE false;
818 INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan o)"
819 DETAIL:  Conflict set hint.
820 INFO:  parameter "enable_indexscan" requires a Boolean value
821 LOG:  pg_hint_plan:
822 used hint:
823 not used hint:
824 duplication hint:
825 Set(enable_indexscan on)
826 error hint:
827 Set(enable_indexscan o)
828
829  c1 | c2 | c3 | c4 
830 ----+----+----+----
831 (0 rows)
832
833 -- No. G-2-3-4
834 /*+Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)*/
835 SELECT * FROM s1.t1 WHERE false;
836 INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
837 DETAIL:  Conflict set hint.
838 INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
839 DETAIL:  Conflict set hint.
840 INFO:  invalid value for parameter "client_min_messages": "DEBU"
841 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error.
842 LOG:  pg_hint_plan:
843 used hint:
844 not used hint:
845 duplication hint:
846 Set(client_min_messages DEBUG5)
847 Set(client_min_messages WARNING)
848 error hint:
849 Set(client_min_messages DEBU)
850
851  c1 | c2 | c3 | c4 
852 ----+----+----+----
853 (0 rows)
854
855 ----
856 ---- No. G-2-4 debug message
857 ----
858 -- No. G-2-4-1
859 /*+SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) */
860 SELECT * FROM s1.t1 a, s1.t2 b WHERE false;
861 INFO:  pg_hint_plan: hint syntax error at or near " "
862 DETAIL:  NestLoop hint requires at least two relations.
863 INFO:  pg_hint_plan: hint syntax error at or near "SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) "
864 DETAIL:  Conflict scan method hint.
865 LOG:  pg_hint_plan:
866 used hint:
867 IndexScan(a)
868 not used hint:
869 SeqScan(c)
870 duplication hint:
871 SeqScan(a)
872 error hint:
873 NestLoop(a)
874
875  c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4 
876 ----+----+----+----+----+----+----+----
877 (0 rows)
878