explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DNJ8

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

GroupAggregate (cost=29,606.12..29,803.12 rows=1,475 width=72) (actual time=218.681..220.062 rows=7 loops=1)

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

Initplan (for GroupAggregate)

3. 0.000 96.878 ↑ 1.0 1 1

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

4. 2.446 96.931 ↓ 1.5 3 1

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

  • Workers Planned: 2
  • Workers Launched: 2
5. 4.550 94.485 ↑ 1.0 1 3 / 3

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

6. 89.935 89.935 ↓ 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.015..89.935 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. 101.152 221.026 ↑ 58.6 21 1

Gather Merge (cost=18,145.71..18,304.59 rows=1,230 width=72) (actual time=218.433..221.026 rows=21 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 1.300 119.874 ↑ 87.9 7 3 / 3

GroupAggregate (cost=17,145.69..17,162.6 rows=615 width=72) (actual time=118.454..119.874 rows=7 loops=3)

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

Sort (cost=17,145.69..17,147.22 rows=615 width=38) (actual time=118.217..118.574 rows=4,309 loops=3)

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

Nested Loop (cost=0.43..17,117.2 rows=615 width=38) (actual time=0.035..115.736 rows=4,309 loops=3)

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

Seq Scan on customer customer (cost=0..10,450.25 rows=1,458 width=26) (actual time=0.013..65.364 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. 38.287 38.287 ↑ 17.0 1 38,287 / 3

Index Only Scan using orders_ckey on orders orders (cost=0.43..47.34 rows=17 width=4) (actual time=0.003..0.003 rows=1 loops=38,287)

  • Index Cond: (o_custkey = customer.c_custkey)
  • Heap Fetches: 25,360
Planning time : 0.326 ms
Execution time : 221.214 ms