

======================================================================
 QUERY FILE: 22 (22.sql)
 TIMESTAMP:  Mon Dec 15 19:09:35 CST 2025
======================================================================

--- [ CONFIG: dp ] ----------------------------------------
Limit  (cost=62060.44..62060.46 rows=1 width=72) (actual time=269.604..269.608 rows=1.00 loops=1)
  Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), (count(*)), (sum(customer.c_acctbal))
  Buffers: shared hit=33316
  InitPlan expr_1
    ->  Aggregate  (cost=7543.38..7543.39 rows=1 width=32) (actual time=42.431..42.432 rows=1.00 loops=1)
          Output: avg(customer_1.c_acctbal)
          Buffers: shared hit=3594
          ->  Seq Scan on public.customer customer_1  (cost=0.00..7531.50 rows=4753 width=6) (actual time=0.004..41.019 rows=32595.00 loops=1)
                Output: customer_1.c_custkey, customer_1.c_name, customer_1.c_address, customer_1.c_nationkey, customer_1.c_phone, customer_1.c_acctbal, customer_1.c_mktsegment, customer_1.c_comment
                Filter: ((customer_1.c_acctbal > 0.00) AND (SUBSTRING(customer_1.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                Rows Removed by Filter: 117405
                Buffers: shared hit=3594
  ->  GroupAggregate  (cost=54517.04..54537.25 rows=735 width=72) (actual time=269.603..269.606 rows=1.00 loops=1)
        Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), count(*), sum(customer.c_acctbal)
        Group Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
        Buffers: shared hit=33316
        ->  Sort  (cost=54517.04..54518.88 rows=735 width=38) (actual time=269.511..269.532 rows=911.00 loops=1)
              Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), customer.c_acctbal
              Sort Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
              Sort Method: quicksort  Memory: 361kB
              Buffers: shared hit=33316
              ->  Hash Right Anti Join  (cost=7553.38..54482.05 rows=735 width=38) (actual time=268.069..268.904 rows=5411.00 loops=1)
                    Output: SUBSTRING(customer.c_phone FROM 1 FOR 2), customer.c_acctbal
                    Hash Cond: (orders.o_custkey = customer.c_custkey)
                    Buffers: shared hit=33313
                    ->  Seq Scan on public.orders  (cost=0.00..41125.00 rows=1500000 width=4) (actual time=0.027..89.991 rows=1500000.00 loops=1)
                          Output: orders.o_orderkey, orders.o_custkey, orders.o_orderstatus, orders.o_totalprice, orders.o_orderdate, orders.o_orderpriority, orders.o_clerk, orders.o_shippriority, orders.o_comment
                          Buffers: shared hit=26125
                    ->  Hash  (cost=7531.50..7531.50 rows=1750 width=26) (actual time=68.985..68.985 rows=16368.00 loops=1)
                          Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                          Buckets: 16384 (originally 2048)  Batches: 1 (originally 1)  Memory Usage: 1088kB
                          Buffers: shared hit=7188
                          ->  Seq Scan on public.customer  (cost=0.00..7531.50 rows=1750 width=26) (actual time=42.447..67.501 rows=16368.00 loops=1)
                                Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                                Filter: ((customer.c_acctbal > (InitPlan expr_1).col1) AND (SUBSTRING(customer.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                                Rows Removed by Filter: 133632
                                Buffers: shared hit=7188
Planning:
  Buffers: shared hit=172
Planning Time: 0.361 ms
Execution Time: 269.669 ms

--- [ CONFIG: goo_rows ] ----------------------------------------
Limit  (cost=62060.44..62060.46 rows=1 width=72) (actual time=229.170..229.172 rows=1.00 loops=1)
  Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), (count(*)), (sum(customer.c_acctbal))
  Buffers: shared hit=33316
  InitPlan expr_1
    ->  Aggregate  (cost=7543.38..7543.39 rows=1 width=32) (actual time=39.121..39.121 rows=1.00 loops=1)
          Output: avg(customer_1.c_acctbal)
          Buffers: shared hit=3594
          ->  Seq Scan on public.customer customer_1  (cost=0.00..7531.50 rows=4753 width=6) (actual time=0.003..37.781 rows=32595.00 loops=1)
                Output: customer_1.c_custkey, customer_1.c_name, customer_1.c_address, customer_1.c_nationkey, customer_1.c_phone, customer_1.c_acctbal, customer_1.c_mktsegment, customer_1.c_comment
                Filter: ((customer_1.c_acctbal > 0.00) AND (SUBSTRING(customer_1.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                Rows Removed by Filter: 117405
                Buffers: shared hit=3594
  ->  GroupAggregate  (cost=54517.04..54537.25 rows=735 width=72) (actual time=229.169..229.170 rows=1.00 loops=1)
        Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), count(*), sum(customer.c_acctbal)
        Group Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
        Buffers: shared hit=33316
        ->  Sort  (cost=54517.04..54518.88 rows=735 width=38) (actual time=229.084..229.104 rows=911.00 loops=1)
              Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), customer.c_acctbal
              Sort Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
              Sort Method: quicksort  Memory: 361kB
              Buffers: shared hit=33316
              ->  Hash Right Anti Join  (cost=7553.38..54482.05 rows=735 width=38) (actual time=227.688..228.510 rows=5411.00 loops=1)
                    Output: SUBSTRING(customer.c_phone FROM 1 FOR 2), customer.c_acctbal
                    Hash Cond: (orders.o_custkey = customer.c_custkey)
                    Buffers: shared hit=33313
                    ->  Seq Scan on public.orders  (cost=0.00..41125.00 rows=1500000 width=4) (actual time=0.039..59.366 rows=1500000.00 loops=1)
                          Output: orders.o_orderkey, orders.o_custkey, orders.o_orderstatus, orders.o_totalprice, orders.o_orderdate, orders.o_orderpriority, orders.o_clerk, orders.o_shippriority, orders.o_comment
                          Buffers: shared hit=26125
                    ->  Hash  (cost=7531.50..7531.50 rows=1750 width=26) (actual time=65.283..65.283 rows=16368.00 loops=1)
                          Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                          Buckets: 16384 (originally 2048)  Batches: 1 (originally 1)  Memory Usage: 1088kB
                          Buffers: shared hit=7188
                          ->  Seq Scan on public.customer  (cost=0.00..7531.50 rows=1750 width=26) (actual time=39.130..63.690 rows=16368.00 loops=1)
                                Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                                Filter: ((customer.c_acctbal > (InitPlan expr_1).col1) AND (SUBSTRING(customer.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                                Rows Removed by Filter: 133632
                                Buffers: shared hit=7188
Planning:
  Buffers: shared hit=172
Planning Time: 0.326 ms
Execution Time: 229.218 ms

--- [ CONFIG: goo_selectivity ] ----------------------------------------
Limit  (cost=62060.44..62060.46 rows=1 width=72) (actual time=234.012..234.013 rows=1.00 loops=1)
  Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), (count(*)), (sum(customer.c_acctbal))
  Buffers: shared hit=33316
  InitPlan expr_1
    ->  Aggregate  (cost=7543.38..7543.39 rows=1 width=32) (actual time=38.952..38.952 rows=1.00 loops=1)
          Output: avg(customer_1.c_acctbal)
          Buffers: shared hit=3594
          ->  Seq Scan on public.customer customer_1  (cost=0.00..7531.50 rows=4753 width=6) (actual time=0.003..37.588 rows=32595.00 loops=1)
                Output: customer_1.c_custkey, customer_1.c_name, customer_1.c_address, customer_1.c_nationkey, customer_1.c_phone, customer_1.c_acctbal, customer_1.c_mktsegment, customer_1.c_comment
                Filter: ((customer_1.c_acctbal > 0.00) AND (SUBSTRING(customer_1.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                Rows Removed by Filter: 117405
                Buffers: shared hit=3594
  ->  GroupAggregate  (cost=54517.04..54537.25 rows=735 width=72) (actual time=234.011..234.011 rows=1.00 loops=1)
        Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), count(*), sum(customer.c_acctbal)
        Group Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
        Buffers: shared hit=33316
        ->  Sort  (cost=54517.04..54518.88 rows=735 width=38) (actual time=233.915..233.934 rows=911.00 loops=1)
              Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), customer.c_acctbal
              Sort Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
              Sort Method: quicksort  Memory: 361kB
              Buffers: shared hit=33316
              ->  Hash Right Anti Join  (cost=7553.38..54482.05 rows=735 width=38) (actual time=232.507..233.349 rows=5411.00 loops=1)
                    Output: SUBSTRING(customer.c_phone FROM 1 FOR 2), customer.c_acctbal
                    Hash Cond: (orders.o_custkey = customer.c_custkey)
                    Buffers: shared hit=33313
                    ->  Seq Scan on public.orders  (cost=0.00..41125.00 rows=1500000 width=4) (actual time=0.021..59.934 rows=1500000.00 loops=1)
                          Output: orders.o_orderkey, orders.o_custkey, orders.o_orderstatus, orders.o_totalprice, orders.o_orderdate, orders.o_orderpriority, orders.o_clerk, orders.o_shippriority, orders.o_comment
                          Buffers: shared hit=26125
                    ->  Hash  (cost=7531.50..7531.50 rows=1750 width=26) (actual time=65.137..65.137 rows=16368.00 loops=1)
                          Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                          Buckets: 16384 (originally 2048)  Batches: 1 (originally 1)  Memory Usage: 1088kB
                          Buffers: shared hit=7188
                          ->  Seq Scan on public.customer  (cost=0.00..7531.50 rows=1750 width=26) (actual time=38.961..63.715 rows=16368.00 loops=1)
                                Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                                Filter: ((customer.c_acctbal > (InitPlan expr_1).col1) AND (SUBSTRING(customer.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                                Rows Removed by Filter: 133632
                                Buffers: shared hit=7188
Planning:
  Buffers: shared hit=172
Planning Time: 0.318 ms
Execution Time: 234.062 ms

--- [ CONFIG: goo_result_size ] ----------------------------------------
Limit  (cost=62060.44..62060.46 rows=1 width=72) (actual time=232.368..232.370 rows=1.00 loops=1)
  Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), (count(*)), (sum(customer.c_acctbal))
  Buffers: shared hit=33316
  InitPlan expr_1
    ->  Aggregate  (cost=7543.38..7543.39 rows=1 width=32) (actual time=39.445..39.445 rows=1.00 loops=1)
          Output: avg(customer_1.c_acctbal)
          Buffers: shared hit=3594
          ->  Seq Scan on public.customer customer_1  (cost=0.00..7531.50 rows=4753 width=6) (actual time=0.003..38.073 rows=32595.00 loops=1)
                Output: customer_1.c_custkey, customer_1.c_name, customer_1.c_address, customer_1.c_nationkey, customer_1.c_phone, customer_1.c_acctbal, customer_1.c_mktsegment, customer_1.c_comment
                Filter: ((customer_1.c_acctbal > 0.00) AND (SUBSTRING(customer_1.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                Rows Removed by Filter: 117405
                Buffers: shared hit=3594
  ->  GroupAggregate  (cost=54517.04..54537.25 rows=735 width=72) (actual time=232.367..232.368 rows=1.00 loops=1)
        Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), count(*), sum(customer.c_acctbal)
        Group Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
        Buffers: shared hit=33316
        ->  Sort  (cost=54517.04..54518.88 rows=735 width=38) (actual time=232.279..232.300 rows=911.00 loops=1)
              Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), customer.c_acctbal
              Sort Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
              Sort Method: quicksort  Memory: 361kB
              Buffers: shared hit=33316
              ->  Hash Right Anti Join  (cost=7553.38..54482.05 rows=735 width=38) (actual time=230.805..231.700 rows=5411.00 loops=1)
                    Output: SUBSTRING(customer.c_phone FROM 1 FOR 2), customer.c_acctbal
                    Hash Cond: (orders.o_custkey = customer.c_custkey)
                    Buffers: shared hit=33313
                    ->  Seq Scan on public.orders  (cost=0.00..41125.00 rows=1500000 width=4) (actual time=0.019..59.440 rows=1500000.00 loops=1)
                          Output: orders.o_orderkey, orders.o_custkey, orders.o_orderstatus, orders.o_totalprice, orders.o_orderdate, orders.o_orderpriority, orders.o_clerk, orders.o_shippriority, orders.o_comment
                          Buffers: shared hit=26125
                    ->  Hash  (cost=7531.50..7531.50 rows=1750 width=26) (actual time=65.614..65.614 rows=16368.00 loops=1)
                          Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                          Buckets: 16384 (originally 2048)  Batches: 1 (originally 1)  Memory Usage: 1088kB
                          Buffers: shared hit=7188
                          ->  Seq Scan on public.customer  (cost=0.00..7531.50 rows=1750 width=26) (actual time=39.457..64.100 rows=16368.00 loops=1)
                                Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                                Filter: ((customer.c_acctbal > (InitPlan expr_1).col1) AND (SUBSTRING(customer.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                                Rows Removed by Filter: 133632
                                Buffers: shared hit=7188
Planning:
  Buffers: shared hit=172
Planning Time: 0.343 ms
Execution Time: 232.430 ms

--- [ CONFIG: goo_cost ] ----------------------------------------
Limit  (cost=62060.44..62060.46 rows=1 width=72) (actual time=280.296..280.298 rows=1.00 loops=1)
  Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), (count(*)), (sum(customer.c_acctbal))
  Buffers: shared hit=33316
  InitPlan expr_1
    ->  Aggregate  (cost=7543.38..7543.39 rows=1 width=32) (actual time=41.130..41.131 rows=1.00 loops=1)
          Output: avg(customer_1.c_acctbal)
          Buffers: shared hit=3594
          ->  Seq Scan on public.customer customer_1  (cost=0.00..7531.50 rows=4753 width=6) (actual time=0.003..39.711 rows=32595.00 loops=1)
                Output: customer_1.c_custkey, customer_1.c_name, customer_1.c_address, customer_1.c_nationkey, customer_1.c_phone, customer_1.c_acctbal, customer_1.c_mktsegment, customer_1.c_comment
                Filter: ((customer_1.c_acctbal > 0.00) AND (SUBSTRING(customer_1.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                Rows Removed by Filter: 117405
                Buffers: shared hit=3594
  ->  GroupAggregate  (cost=54517.04..54537.25 rows=735 width=72) (actual time=280.295..280.296 rows=1.00 loops=1)
        Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), count(*), sum(customer.c_acctbal)
        Group Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
        Buffers: shared hit=33316
        ->  Sort  (cost=54517.04..54518.88 rows=735 width=38) (actual time=280.205..280.225 rows=911.00 loops=1)
              Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), customer.c_acctbal
              Sort Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
              Sort Method: quicksort  Memory: 361kB
              Buffers: shared hit=33316
              ->  Hash Right Anti Join  (cost=7553.38..54482.05 rows=735 width=38) (actual time=278.799..279.646 rows=5411.00 loops=1)
                    Output: SUBSTRING(customer.c_phone FROM 1 FOR 2), customer.c_acctbal
                    Hash Cond: (orders.o_custkey = customer.c_custkey)
                    Buffers: shared hit=33313
                    ->  Seq Scan on public.orders  (cost=0.00..41125.00 rows=1500000 width=4) (actual time=0.029..60.009 rows=1500000.00 loops=1)
                          Output: orders.o_orderkey, orders.o_custkey, orders.o_orderstatus, orders.o_totalprice, orders.o_orderdate, orders.o_orderpriority, orders.o_clerk, orders.o_shippriority, orders.o_comment
                          Buffers: shared hit=26125
                    ->  Hash  (cost=7531.50..7531.50 rows=1750 width=26) (actual time=102.290..102.291 rows=16368.00 loops=1)
                          Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                          Buckets: 16384 (originally 2048)  Batches: 1 (originally 1)  Memory Usage: 1088kB
                          Buffers: shared hit=7188
                          ->  Seq Scan on public.customer  (cost=0.00..7531.50 rows=1750 width=26) (actual time=41.142..100.637 rows=16368.00 loops=1)
                                Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                                Filter: ((customer.c_acctbal > (InitPlan expr_1).col1) AND (SUBSTRING(customer.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                                Rows Removed by Filter: 133632
                                Buffers: shared hit=7188
Planning:
  Buffers: shared hit=172
Planning Time: 0.319 ms
Execution Time: 280.348 ms

--- [ CONFIG: geqo ] ----------------------------------------
Limit  (cost=62060.44..62060.46 rows=1 width=72) (actual time=242.544..242.546 rows=1.00 loops=1)
  Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), (count(*)), (sum(customer.c_acctbal))
  Buffers: shared hit=33316
  InitPlan expr_1
    ->  Aggregate  (cost=7543.38..7543.39 rows=1 width=32) (actual time=38.817..38.818 rows=1.00 loops=1)
          Output: avg(customer_1.c_acctbal)
          Buffers: shared hit=3594
          ->  Seq Scan on public.customer customer_1  (cost=0.00..7531.50 rows=4753 width=6) (actual time=0.003..37.456 rows=32595.00 loops=1)
                Output: customer_1.c_custkey, customer_1.c_name, customer_1.c_address, customer_1.c_nationkey, customer_1.c_phone, customer_1.c_acctbal, customer_1.c_mktsegment, customer_1.c_comment
                Filter: ((customer_1.c_acctbal > 0.00) AND (SUBSTRING(customer_1.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                Rows Removed by Filter: 117405
                Buffers: shared hit=3594
  ->  GroupAggregate  (cost=54517.04..54537.25 rows=735 width=72) (actual time=242.543..242.544 rows=1.00 loops=1)
        Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), count(*), sum(customer.c_acctbal)
        Group Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
        Buffers: shared hit=33316
        ->  Sort  (cost=54517.04..54518.88 rows=735 width=38) (actual time=242.451..242.472 rows=911.00 loops=1)
              Output: (SUBSTRING(customer.c_phone FROM 1 FOR 2)), customer.c_acctbal
              Sort Key: (SUBSTRING(customer.c_phone FROM 1 FOR 2))
              Sort Method: quicksort  Memory: 361kB
              Buffers: shared hit=33316
              ->  Hash Right Anti Join  (cost=7553.38..54482.05 rows=735 width=38) (actual time=241.009..241.869 rows=5411.00 loops=1)
                    Output: SUBSTRING(customer.c_phone FROM 1 FOR 2), customer.c_acctbal
                    Hash Cond: (orders.o_custkey = customer.c_custkey)
                    Buffers: shared hit=33313
                    ->  Seq Scan on public.orders  (cost=0.00..41125.00 rows=1500000 width=4) (actual time=0.016..61.978 rows=1500000.00 loops=1)
                          Output: orders.o_orderkey, orders.o_custkey, orders.o_orderstatus, orders.o_totalprice, orders.o_orderdate, orders.o_orderpriority, orders.o_clerk, orders.o_shippriority, orders.o_comment
                          Buffers: shared hit=26125
                    ->  Hash  (cost=7531.50..7531.50 rows=1750 width=26) (actual time=64.722..64.722 rows=16368.00 loops=1)
                          Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                          Buckets: 16384 (originally 2048)  Batches: 1 (originally 1)  Memory Usage: 1088kB
                          Buffers: shared hit=7188
                          ->  Seq Scan on public.customer  (cost=0.00..7531.50 rows=1750 width=26) (actual time=38.828..63.368 rows=16368.00 loops=1)
                                Output: customer.c_phone, customer.c_acctbal, customer.c_custkey
                                Filter: ((customer.c_acctbal > (InitPlan expr_1).col1) AND (SUBSTRING(customer.c_phone FROM 1 FOR 2) = ANY ('{30,38,24,26,25,29,20}'::text[])))
                                Rows Removed by Filter: 133632
                                Buffers: shared hit=7188
Planning:
  Buffers: shared hit=172
Planning Time: 0.445 ms
Execution Time: 242.622 ms
