explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xjZE

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 790.574 ↑ 210.7 7 1

GroupAggregate (cost=113,050.18..113,247.18 rows=1,475 width=72) (actual time=789.336..790.574 rows=7 loops=1)

  • Group Key: (substr((customer.c_phone)::text, 1, 2))
2.          

Initplan (for GroupAggregate)

3. 0.000 96.594 ↑ 1.0 1 1

Aggregate (cost=11,460.41..11,460.42 rows=1 width=32) (actual time=96.593..96.594 rows=1 loops=1)

4. 2.373 96.640 ↓ 1.5 3 1

Gather (cost=11,460.18..11,460.39 rows=2 width=32) (actual time=96.516..96.64 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 4.519 94.267 ↑ 1.0 1 3 / 3

Aggregate (cost=10,460.18..10,460.19 rows=1 width=32) (actual time=94.267..94.267 rows=1 loops=3)

6. 89.748 89.748 ↓ 6.4 25,598 3 / 3

Seq Scan on customer customer_1 (cost=0..10,450.25 rows=3,972 width=6) (actual time=0.019..89.748 rows=25,598 loops=3)

  • Filter: ((c_acctbal > 0.00) AND (substr((c_phone)::text, 1, 2) = ANY ('{18,15,34,31,33,12,20}'::text[])))
7. 126.951 815.058 ↑ 58.6 21 1

Gather Merge (cost=101,589.76..101,748.65 rows=1,230 width=72) (actual time=789.07..815.058 rows=21 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 1.146 688.107 ↑ 87.9 7 3 / 3

GroupAggregate (cost=100,589.74..100,606.65 rows=615 width=72) (actual time=686.834..688.107 rows=7 loops=3)

  • Group Key: (substr((customer.c_phone)::text, 1, 2))
9. 2.286 686.961 ↓ 7.0 4,309 3 / 3

Sort (cost=100,589.74..100,591.28 rows=615 width=38) (actual time=686.611..686.961 rows=4,309 loops=3)

  • Sort Key: (substr((customer.c_phone)::text, 1, 2))
  • Sort Method: quicksort Memory: 399kB
10. 140.612 684.675 ↓ 7.0 4,309 3 / 3

Hash Join (cost=85,194..100,561.25 rows=615 width=38) (actual time=558.916..684.675 rows=4,309 loops=3)

11. 65.545 65.545 ↓ 8.8 12,762 3 / 3

Seq Scan on customer customer (cost=0..10,450.25 rows=1,458 width=26) (actual time=0.024..65.545 rows=12,762 loops=3)

  • Filter: ((c_acctbal > $1) AND (substr((c_phone)::text, 1, 2) = ANY ('{18,15,34,31,33,12,20}'::text[])))
12. 240.133 478.518 ↑ 1.2 1,000,000 3 / 3

Hash (cost=64,686..64,686 rows=1,250,000 width=4) (actual time=478.518..478.518 rows=1,000,000 loops=3)

13. 238.385 238.385 ↑ 1.2 1,000,000 3 / 3

Seq Scan on orders orders (cost=0..64,686 rows=1,250,000 width=4) (actual time=0.008..238.385 rows=1,000,000 loops=3)

Planning time : 0.364 ms
Execution time : 815.807 ms