explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZKrk

Settings
# exclusive inclusive rows x rows loops node
1. 2.711 12.857 ↓ 0.0 0 1

Insert on temp_posting (cost=144.59..1,691.99 rows=1 width=9) (actual time=12.857..12.857 rows=0 loops=1)

2.          

CTE my_shippers

3. 0.007 0.165 ↓ 1.9 13 1

Group (cost=140.02..140.05 rows=7 width=8) (actual time=0.156..0.165 rows=13 loops=1)

  • Group Key: cc.business_id
4. 0.014 0.158 ↓ 2.9 20 1

Sort (cost=140.02..140.03 rows=7 width=8) (actual time=0.155..0.158 rows=20 loops=1)

  • Sort Key: cc.business_id
  • Sort Method: quicksort Memory: 25kB
5. 0.011 0.144 ↓ 2.9 20 1

Nested Loop (cost=1.13..139.92 rows=7 width=8) (actual time=0.026..0.144 rows=20 loops=1)

6. 0.017 0.093 ↓ 1.2 20 1

Nested Loop (cost=0.85..133.76 rows=16 width=16) (actual time=0.021..0.093 rows=20 loops=1)

7. 0.005 0.048 ↑ 1.0 14 1

Nested Loop (cost=0.56..115.81 rows=14 width=16) (actual time=0.014..0.048 rows=14 loops=1)

8. 0.015 0.015 ↑ 1.0 14 1

Index Scan using idx_user_business_link_business_id on user_business_link ubl (cost=0.28..11.47 rows=14 width=8) (actual time=0.008..0.015 rows=14 loops=1)

  • Index Cond: (business_id = '1703858125129385245'::bigint)
9. 0.028 0.028 ↑ 1.0 1 14

Index Only Scan using idx_business_user_id_status on business_user bu (cost=0.28..7.44 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=14)

  • Index Cond: (id = ubl.user_id)
  • Heap Fetches: 14
10. 0.028 0.028 ↑ 32.0 1 14

Index Scan using idx_carrier_contact_user_id on carrier_contact cc (cost=0.28..0.96 rows=32 width=24) (actual time=0.002..0.002 rows=1 loops=14)

  • Index Cond: (user_id = bu.id)
11. 0.040 0.040 ↑ 1.0 1 20

Index Scan using carrier_contact_business_pkey on carrier_contact_business ccb (cost=0.28..0.37 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=20)

  • Index Cond: (id = cc.carrier_contact_business_id)
  • Filter: (network_type = 4800)
12. 0.662 10.146 ↓ 4,100.0 4,100 1

Nested Loop (cost=4.54..1,551.94 rows=1 width=9) (actual time=0.186..10.146 rows=4,100 loops=1)

13. 0.176 0.176 ↓ 1.9 13 1

CTE Scan on my_shippers (cost=0.00..0.14 rows=7 width=8) (actual time=0.158..0.176 rows=13 loops=1)

14. 4.649 9.308 ↓ 315.0 315 13

Bitmap Heap Scan on posting p (cost=4.54..221.68 rows=1 width=16) (actual time=0.049..0.716 rows=315 loops=13)

  • Recheck Cond: (business_id = my_shippers.business_id)
  • Filter: (is_public AND (status <> 1802) AND (status <> 1800) AND ((SubPlan 2) = 0))
  • Rows Removed by Filter: 4
  • Heap Blocks: exact=139
15. 0.559 0.559 ↓ 15.2 319 13

Bitmap Index Scan on idx_posting_business_id_status_is_public (cost=0.00..4.54 rows=21 width=0) (actual time=0.043..0.043 rows=319 loops=13)

  • Index Cond: ((business_id = my_shippers.business_id) AND (is_public = true))
16.          

SubPlan (forBitmap Heap Scan)

17. 0.000 4.100 ↑ 1.0 1 4,100

Aggregate (cost=8.31..8.32 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=4,100)

18. 4.100 4.100 ↓ 0.0 0 4,100

Index Scan using idx_posting_link_posting_id_status on posting_link pl (cost=0.29..8.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=4,100)

  • Index Cond: ((posting_id = p.id) AND (status = 1905))
  • Filter: (posted_to_user_id = '1693876186242876624'::bigint)