@@ -410,8 +410,7 @@ WHERE a < 3 AND b < 3 AND c < 3 AND d < 3;
410410 Index Scan using aqo_test0_idx_a on aqo_test0 (cost=0.28..8.35 rows=3 width=16)
411411 Index Cond: (a < 3)
412412 Filter: ((b < 3) AND (c < 3) AND (d < 3))
413- Using aqo: true
414- (4 rows)
413+ (3 rows)
415414
416415EXPLAIN SELECT * FROM aqo_test0
417416WHERE a < 4 AND b < 4 AND c < 4 AND d < 4;
@@ -420,8 +419,7 @@ WHERE a < 4 AND b < 4 AND c < 4 AND d < 4;
420419 Index Scan using aqo_test0_idx_a on aqo_test0 (cost=0.28..8.38 rows=4 width=16)
421420 Index Cond: (a < 4)
422421 Filter: ((b < 4) AND (c < 4) AND (d < 4))
423- Using aqo: true
424- (4 rows)
422+ (3 rows)
425423
426424EXPLAIN SELECT * FROM aqo_test0
427425WHERE a < 5 AND b < 5 AND c < 5 AND d < 5;
@@ -430,8 +428,7 @@ WHERE a < 5 AND b < 5 AND c < 5 AND d < 5;
430428 Index Scan using aqo_test0_idx_a on aqo_test0 (cost=0.28..8.40 rows=5 width=16)
431429 Index Cond: (a < 5)
432430 Filter: ((b < 5) AND (c < 5) AND (d < 5))
433- Using aqo: true
434- (4 rows)
431+ (3 rows)
435432
436433EXPLAIN SELECT t1.a, t2.b FROM aqo_test0 AS t1, aqo_test0 AS t2
437434WHERE t1.a < 1 AND t1.b < 1 AND t2.c < 1 AND t2.d < 1;
@@ -443,8 +440,7 @@ WHERE t1.a < 1 AND t1.b < 1 AND t2.c < 1 AND t2.d < 1;
443440 Filter: (b < 1)
444441 -> Seq Scan on aqo_test0 t2 (cost=0.00..41.02 rows=1 width=4)
445442 Filter: ((c < 1) AND (d < 1))
446- Using aqo: true
447- (7 rows)
443+ (6 rows)
448444
449445EXPLAIN SELECT t1.a, t2.b FROM aqo_test1 AS t1, aqo_test0 AS t2
450446WHERE t1.a < 1 AND t2.b < 1 AND t2.c < 1 AND t2.d < 1 AND t1.a = t2.a;
@@ -456,8 +452,7 @@ WHERE t1.a < 1 AND t2.b < 1 AND t2.c < 1 AND t2.d < 1 AND t1.a = t2.a;
456452 -> Index Scan using aqo_test0_idx_a on aqo_test0 t2 (cost=0.28..8.30 rows=1 width=8)
457453 Index Cond: (a = t1.a)
458454 Filter: ((b < 1) AND (c < 1) AND (d < 1))
459- Using aqo: true
460- (7 rows)
455+ (6 rows)
461456
462457EXPlAIN SELECT t1.a, t2.b, t3.c
463458FROM aqo_test1 AS t1, aqo_test0 AS t2, aqo_test0 AS t3
@@ -474,8 +469,7 @@ WHERE t1.a < 1 AND t3.b < 1 AND t2.c < 1 AND t3.d < 0 AND t1.a = t2.a AND t1.b =
474469 Filter: (c < 1)
475470 -> Seq Scan on aqo_test0 t3 (cost=0.00..41.02 rows=1 width=8)
476471 Filter: ((b < 1) AND (d < 0))
477- Using aqo: true
478- (11 rows)
472+ (10 rows)
479473
480474EXPLAIN SELECT t1.a AS a, t2.a AS b, t3.a AS c
481475FROM aqo_test1 AS t1, aqo_test1 AS t2, aqo_test1 AS t3
@@ -491,8 +485,7 @@ WHERE t1.a = t2.b AND t2.a = t3.b;
491485 -> Seq Scan on aqo_test1 t2 (cost=0.00..1.20 rows=20 width=8)
492486 -> Hash (cost=1.20..1.20 rows=20 width=8)
493487 -> Seq Scan on aqo_test1 t3 (cost=0.00..1.20 rows=20 width=8)
494- Using aqo: true
495- (10 rows)
488+ (9 rows)
496489
497490EXPLAIN SELECT t1.a AS a, t2.a AS b, t3.a AS c, t4.a AS d
498491FROM aqo_test1 AS t1, aqo_test1 AS t2, aqo_test1 AS t3, aqo_test1 AS t4
@@ -512,8 +505,38 @@ WHERE t1.a = t2.b AND t2.a = t3.b AND t3.a = t4.b;
512505 -> Seq Scan on aqo_test1 t3 (cost=0.00..1.20 rows=20 width=8)
513506 -> Hash (cost=1.20..1.20 rows=20 width=8)
514507 -> Seq Scan on aqo_test1 t4 (cost=0.00..1.20 rows=20 width=8)
508+ (13 rows)
509+
510+ EXPLAIN verbose SELECT t1.a AS a, t2.a AS b, t3.a AS c, t4.a AS d
511+ FROM aqo_test1 AS t1, aqo_test1 AS t2, aqo_test1 AS t3, aqo_test1 AS t4
512+ WHERE t1.a = t2.b AND t2.a = t3.b AND t3.a = t4.b;
513+ QUERY PLAN
514+ --------------------------------------------------------------------------------------------
515+ Hash Join (cost=4.35..6.37 rows=20 width=16)
516+ Output: t1.a, t2.a, t3.a, t4.a
517+ Hash Cond: (t3.a = t4.b)
518+ -> Hash Join (cost=2.90..4.65 rows=20 width=12)
519+ Output: t1.a, t2.a, t3.a
520+ Hash Cond: (t2.a = t3.b)
521+ -> Hash Join (cost=1.45..2.92 rows=20 width=8)
522+ Output: t1.a, t2.a
523+ Hash Cond: (t1.a = t2.b)
524+ -> Seq Scan on public.aqo_test1 t1 (cost=0.00..1.20 rows=20 width=4)
525+ Output: t1.a, t1.b
526+ -> Hash (cost=1.20..1.20 rows=20 width=8)
527+ Output: t2.a, t2.b
528+ -> Seq Scan on public.aqo_test1 t2 (cost=0.00..1.20 rows=20 width=8)
529+ Output: t2.a, t2.b
530+ -> Hash (cost=1.20..1.20 rows=20 width=8)
531+ Output: t3.a, t3.b
532+ -> Seq Scan on public.aqo_test1 t3 (cost=0.00..1.20 rows=20 width=8)
533+ Output: t3.a, t3.b
534+ -> Hash (cost=1.20..1.20 rows=20 width=8)
535+ Output: t4.a, t4.b
536+ -> Seq Scan on public.aqo_test1 t4 (cost=0.00..1.20 rows=20 width=8)
537+ Output: t4.a, t4.b
515538 Using aqo: true
516- (14 rows)
539+ (24 rows)
517540
518541DROP INDEX aqo_test0_idx_a;
519542DROP TABLE aqo_test0;