explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7lVJ

Settings
# exclusive inclusive rows x rows loops node
1. 13,987.970 305,410.814 ↑ 3.9 17,567,694 1

Nested Loop (cost=1,759.19..24,891,199.24 rows=68,221,950 width=4) (actual time=1.145..305,410.814 rows=17,567,694 loops=1)

  • Planning time: 0.770 ms
  • Execution time: 311761.654 ms
2. 2.096 2.988 ↑ 2.9 432 1

HashAggregate (cost=1,758.62..1,771.22 rows=1,260 width=4) (actual time=1.128..2.988 rows=432 loops=1)

  • Group Key: service_providers.spid
3. 0.316 0.892 ↑ 2.9 432 1

Nested Loop (cost=1,415.58..1,755.47 rows=1,260 width=4) (actual time=0.239..0.892 rows=432 loops=1)

4. 0.012 0.232 ↑ 50.0 4 1

HashAggregate (cost=1,415.30..1,417.30 rows=200 width=4) (actual time=0.228..0.232 rows=4 loops=1)

  • Group Key: q.gnid
5. 0.220 0.220 ↑ 750.2 4 1

CTE Scan on q (cost=1,317.77..1,377.79 rows=3,001 width=104) (actual time=0.016..0.220 rows=4 loops=1)

6.          

CTE q

7. 0.010 0.213 ↑ 750.2 4 1

Recursive Union (cost=0.28..1,317.77 rows=3,001 width=130) (actual time=0.013..0.213 rows=4 loops=1)

8. 0.013 0.013 ↑ 1.0 1 1

Index Scan using sp_group_pkey on group_ h (cost=0.28..2.50 rows=1 width=130) (actual time=0.010..0.013 rows=1 loops=1)

  • Index Cond: (gnid = 506094392)
9. 0.018 0.190 ↑ 150.0 2 2

Nested Loop (cost=0.28..125.53 rows=300 width=130) (actual time=0.073..0.095 rows=2 loops=2)

10. 0.004 0.004 ↑ 5.0 2 2

WorkTable Scan on q q_1 (cost=0.00..0.20 rows=10 width=72) (actual time=0.001..0.002 rows=2 loops=2)

11. 0.168 0.168 ↑ 30.0 1 4

Index Scan using sp_group_un_groupname on group_ hi (cost=0.28..12.01 rows=30 width=62) (actual time=0.032..0.042 rows=1 loops=4)

  • Index Cond: (parentid = q_1.gnid)
12. 0.344 0.344 ↓ 54.0 108 4

Index Scan using service_providers_fk1_serp on service_providers (cost=0.28..1.67 rows=2 width=8) (actual time=0.005..0.086 rows=108 loops=4)

  • Index Cond: (gnid = q.gnid)
13. 291,419.856 291,419.856 ↑ 1.3 40,666 432

Index Scan using booking_spid_idx1 on booking (cost=0.57..19,212.07 rows=54,144 width=8) (actual time=0.646..674.583 rows=40,666 loops=432)

  • Index Cond: (spid = service_providers.spid)