explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6fz

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 8.467 892.521 ↑ 1.0 1 1

Aggregate (cost=117,898.88..117,898.89 rows=1 width=0) (actual time=892.521..892.521 rows=1 loops=1)

2. 23.707 884.054 ↓ 64.3 21,075 1

Hash Left Join (cost=101,806.62..117,898.05 rows=328 width=0) (actual time=282.407..884.054 rows=21,075 loops=1)

  • Hash Cond: (booking_line.id_provider = provider.id)
3. 22.814 854.989 ↓ 64.3 21,075 1

Hash Left Join (cost=101,517.32..117,604.32 rows=328 width=4) (actual time=277.034..854.989 rows=21,075 loops=1)

  • Hash Cond: ((booking.id_assigned_to)::text = ("user".id)::text)
4. 20.741 830.717 ↓ 64.3 21,075 1

Hash Join (cost=101,445.58..117,528.06 rows=328 width=37) (actual time=275.519..830.717 rows=21,075 loops=1)

  • Hash Cond: (booking_line.id_pickup_zone = zone_translation.id_zone)
5. 30.139 808.097 ↓ 30.7 21,075 1

Nested Loop (cost=101,295.06..117,364.83 rows=686 width=41) (actual time=273.613..808.097 rows=21,075 loops=1)

6. 42.618 714.733 ↓ 30.7 21,075 1

Nested Loop Left Join (cost=101,295.06..112,440.35 rows=686 width=45) (actual time=273.581..714.733 rows=21,075 loops=1)

7. 20.069 587.815 ↓ 30.7 21,075 1

Hash Left Join (cost=101,295.06..107,521.04 rows=686 width=49) (actual time=273.551..587.815 rows=21,075 loops=1)

  • Hash Cond: (booking.id_sales_agent = agent_1.id)
8. 22.286 558.746 ↓ 30.7 21,075 1

Hash Join (cost=100,841.78..107,057.13 rows=686 width=53) (actual time=264.533..558.746 rows=21,075 loops=1)

  • Hash Cond: (booking.id_agent = agent.id)
9. 176.186 526.840 ↓ 30.7 21,075 1

Hash Join (cost=100,388.50..106,587.56 rows=686 width=57) (actual time=254.897..526.840 rows=21,075 loops=1)

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

Seq Scan on booking_line_activity (cost=0.00..5,332.78 rows=229,178 width=4) (actual time=0.008..96.346 rows=229,123 loops=1)

11. 13.266 254.308 ↓ 1.6 21,075 1

Hash (cost=100,228.43..100,228.43 rows=12,806 width=61) (actual time=254.308..254.308 rows=21,075 loops=1)

12. 39.568 241.042 ↓ 1.6 21,075 1

Nested Loop (cost=1.13..100,228.43 rows=12,806 width=61) (actual time=0.087..241.042 rows=21,075 loops=1)

13. 23.467 75.024 ↓ 1.7 21,075 1

Hash Join (cost=1.13..6,718.92 rows=12,594 width=53) (actual time=0.047..75.024 rows=21,075 loops=1)

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

Seq Scan on booking (cost=0.00..6,497.40 rows=25,187 width=57) (actual time=0.019..51.541 rows=25,551 loops=1)

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

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

16. 0.012 0.012 ↓ 1.3 4 1

Seq Scan on status_type (cost=0.00..1.09 rows=3 width=4) (actual time=0.011..0.012 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.006..0.006 rows=1 loops=21,075)

  • Index Cond: ((booking_line.id_booking = booking.id) AND (booking_line.version = booking.version))
18. 4.398 9.620 ↑ 1.0 9,168 1

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

19. 5.222 5.222 ↑ 1.0 9,168 1

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

20. 4.408 9.000 ↑ 1.0 9,168 1

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

21. 4.592 4.592 ↑ 1.0 9,168 1

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

22. 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)
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.601 1.879 ↑ 1.0 1,260 1

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

25. 1.148 1.278 ↑ 1.0 1,260 1

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

  • Recheck Cond: (id_language = 1)
26. 0.130 0.130 ↑ 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.130..0.130 rows=1,260 loops=1)

  • Index Cond: (id_language = 1)
27. 0.726 1.458 ↑ 1.0 1,411 1

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

28. 0.732 0.732 ↑ 1.0 1,411 1

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

29. 2.451 5.358 ↑ 1.0 5,213 1

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

30. 2.907 2.907 ↑ 1.0 5,213 1

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