explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Eo38 : Optimization for: plan #6fz

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 8.167 846.635 ↑ 1.0 1 1

Aggregate (cost=117,250.36..117,250.37 rows=1 width=0) (actual time=846.634..846.635 rows=1 loops=1)

2. 22.192 838.468 ↓ 64.8 21,075 1

Hash Left Join (cost=101,317.30..117,249.54 rows=325 width=0) (actual time=274.606..838.468 rows=21,075 loops=1)

  • Hash Cond: (booking_line.id_provider = provider.id)
3. 21.708 811.111 ↓ 64.8 21,075 1

Hash Left Join (cost=101,028.01..116,955.85 rows=325 width=4) (actual time=269.432..811.111 rows=21,075 loops=1)

  • Hash Cond: ((booking.id_assigned_to)::text = ("user".id)::text)
4. 19.638 787.950 ↓ 64.8 21,075 1

Hash Join (cost=100,956.26..116,879.63 rows=325 width=37) (actual time=267.968..787.950 rows=21,075 loops=1)

  • Hash Cond: (booking_line.id_pickup_zone = zone_translation.id_zone)
5. 27.503 766.600 ↓ 31.2 21,075 1

Nested Loop (cost=100,805.75..116,716.58 rows=675 width=41) (actual time=266.246..766.600 rows=21,075 loops=1)

6. 21.719 675.872 ↓ 31.2 21,075 1

Hash Join (cost=100,805.75..111,871.03 rows=675 width=45) (actual time=266.223..675.872 rows=21,075 loops=1)

  • Hash Cond: (booking.id_agent = agent.id)
7. 19.291 645.379 ↓ 31.2 21,075 1

Hash Left Join (cost=100,352.47..111,401.71 rows=675 width=49) (actual time=257.440..645.379 rows=21,075 loops=1)

  • Hash Cond: (booking.id_sales_agent = agent_1.id)
8. 39.318 617.332 ↓ 31.2 21,075 1

Nested Loop Left Join (cost=99,899.19..110,937.98 rows=675 width=53) (actual time=248.670..617.332 rows=21,075 loops=1)

9. 152.131 493.714 ↓ 31.2 21,075 1

Hash Join (cost=99,899.19..106,097.38 rows=675 width=57) (actual time=248.634..493.714 rows=21,075 loops=1)

  • Hash Cond: (booking_line_activity.id = booking_line.id_booking_line_activity)
10. 93.415 93.415 ↑ 1.0 229,123 1

Seq Scan on booking_line_activity (cost=0.00..5,332.23 rows=229,123 width=4) (actual time=0.006..93.415 rows=229,123 loops=1)

11. 13.500 248.168 ↓ 1.7 21,075 1

Hash (cost=99,741.08..99,741.08 rows=12,649 width=61) (actual time=248.168..248.168 rows=21,075 loops=1)

12. 34.496 234.668 ↓ 1.7 21,075 1

Nested Loop (cost=1.13..99,741.08 rows=12,649 width=61) (actual time=0.053..234.668 rows=21,075 loops=1)

13. 22.933 73.722 ↓ 1.7 21,075 1

Hash Join (cost=1.13..6,717.45 rows=12,527 width=53) (actual time=0.029..73.722 rows=21,075 loops=1)

  • Hash Cond: (booking.id_status = status_type.id)
14. 50.777 50.777 ↓ 1.0 25,551 1

Seq Scan on booking (cost=0.00..6,497.10 rows=25,054 width=57) (actual time=0.010..50.777 rows=25,551 loops=1)

  • Filter: ((deleted IS NULL) AND (id_owner = 917))
15. 0.002 0.012 ↓ 1.3 4 1

Hash (cost=1.09..1.09 rows=3 width=4) (actual time=0.012..0.012 rows=4 loops=1)

16. 0.010 0.010 ↓ 1.3 4 1

Seq Scan on status_type (cost=0.00..1.09 rows=3 width=4) (actual time=0.006..0.010 rows=4 loops=1)

  • Filter: (id = ANY ('{1,2,3,4}'::integer[]))
17. 126.450 126.450 ↑ 1.0 1 21,075

Index Scan using booking_line_id_booking_version_idx on booking_line (cost=0.00..7.41 rows=1 width=20) (actual time=0.005..0.006 rows=1 loops=21,075)

  • Index Cond: ((booking_line.id_booking = booking.id) AND (booking_line.version = booking.version))
18. 84.300 84.300 ↑ 1.0 1 21,075

Index Scan using booking_totals_pkey on booking_totals (cost=0.00..7.16 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=21,075)

  • Index Cond: (booking_totals.id_booking = booking.id)
19. 4.122 8.756 ↑ 1.0 9,168 1

Hash (cost=338.68..338.68 rows=9,168 width=4) (actual time=8.756..8.756 rows=9,168 loops=1)

20. 4.634 4.634 ↑ 1.0 9,168 1

Seq Scan on agent agent_1 (cost=0.00..338.68 rows=9,168 width=4) (actual time=0.007..4.634 rows=9,168 loops=1)

21. 4.016 8.774 ↑ 1.0 9,168 1

Hash (cost=338.68..338.68 rows=9,168 width=4) (actual time=8.774..8.774 rows=9,168 loops=1)

22. 4.758 4.758 ↑ 1.0 9,168 1

Seq Scan on agent (cost=0.00..338.68 rows=9,168 width=4) (actual time=0.007..4.758 rows=9,168 loops=1)

23. 63.225 63.225 ↑ 1.0 1 21,075

Index Scan using client_pkey on client (cost=0.00..7.17 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=21,075)

  • Index Cond: (client.id = booking.id_client)
24. 0.597 1.712 ↑ 1.0 1,260 1

Hash (cost=134.77..134.77 rows=1,260 width=4) (actual time=1.712..1.712 rows=1,260 loops=1)

25. 1.002 1.115 ↑ 1.0 1,260 1

Bitmap Heap Scan on zone_translation (cost=26.02..134.77 rows=1,260 width=4) (actual time=0.132..1.115 rows=1,260 loops=1)

  • Recheck Cond: (id_language = 1)
26. 0.113 0.113 ↑ 1.0 1,260 1

Bitmap Index Scan on zone_translations_id_language_idx (cost=0.00..25.70 rows=1,260 width=0) (actual time=0.113..0.113 rows=1,260 loops=1)

  • Index Cond: (id_language = 1)
27. 0.722 1.453 ↑ 1.0 1,411 1

Hash (cost=54.11..54.11 rows=1,411 width=36) (actual time=1.453..1.453 rows=1,411 loops=1)

28. 0.731 0.731 ↑ 1.0 1,411 1

Seq Scan on "user" (cost=0.00..54.11 rows=1,411 width=36) (actual time=0.007..0.731 rows=1,411 loops=1)

29. 2.322 5.165 ↑ 1.0 5,213 1

Hash (cost=224.13..224.13 rows=5,213 width=4) (actual time=5.165..5.165 rows=5,213 loops=1)

30. 2.843 2.843 ↑ 1.0 5,213 1

Seq Scan on provider (cost=0.00..224.13 rows=5,213 width=4) (actual time=0.007..2.843 rows=5,213 loops=1)