(Kruskal) QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=474090.39..474090.40 rows=1 width=4) (actual time=3744.711..3744.712 rows=1 loops=1) -> Nested Loop (cost=0.00..474086.63 rows=1501 width=4) (actual time=33.844..3744.296 rows=573 loops=1) Join Filter: (public.lineitem.l_quantity < (subplan)) -> Seq Scan on part (cost=0.00..7063.92 rows=200 width=4) (actual time=0.245..69.567 rows=211 loops=1) Filter: ((p_brand = 'Brand#12'::bpchar) AND (p_container = 'LG CAN'::bpchar)) -> Index Scan using i_l_partkey on lineitem (cost=0.00..95.35 rows=23 width=12) (actual time=12.459..12.482 rows=30 loops=211) Index Cond: (public.lineitem.l_partkey = part.p_partkey) SubPlan -> Aggregate (cost=97.35..97.37 rows=1 width=4) (actual time=0.163..0.163 rows=1 loops=6334) -> Index Scan using i_l_partkey on lineitem (cost=0.00..97.29 rows=23 width=4) (actual time=0.004..0.151 rows=31 loops=6334) Index Cond: (l_partkey = $0) Total runtime: 3744.879 ms (12 rows) Time: 3778,490 ms Timing is on. (Dynamic Programming) QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=474090.39..474090.40 rows=1 width=4) (actual time=1204.064..1204.064 rows=1 loops=1) -> Nested Loop (cost=0.00..474086.63 rows=1501 width=4) (actual time=11.754..1203.669 rows=573 loops=1) Join Filter: (public.lineitem.l_quantity < (subplan)) -> Seq Scan on part (cost=0.00..7063.92 rows=200 width=4) (actual time=0.264..67.012 rows=211 loops=1) Filter: ((p_brand = 'Brand#12'::bpchar) AND (p_container = 'LG CAN'::bpchar)) -> Index Scan using i_l_partkey on lineitem (cost=0.00..95.35 rows=23 width=12) (actual time=3.841..3.864 rows=30 loops=211) Index Cond: (public.lineitem.l_partkey = part.p_partkey) SubPlan -> Aggregate (cost=97.35..97.37 rows=1 width=4) (actual time=0.049..0.049 rows=1 loops=6334) -> Index Scan using i_l_partkey on lineitem (cost=0.00..97.29 rows=23 width=4) (actual time=0.004..0.037 rows=31 loops=6334) Index Cond: (l_partkey = $0) Total runtime: 1204.220 ms (12 rows) Time: 1208,423 ms Timing is on.