explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KjpO

Settings
# exclusive inclusive rows x rows loops node
1. 0.142 22.784 ↑ 7.2 33 1

GroupAggregate (cost=47,216.12..47,234.64 rows=239 width=308) (actual time=22.648..22.784 rows=33 loops=1)

2. 2.184 22.642 ↑ 1.0 237 1

Sort (cost=47,216.12..47,216.71 rows=239 width=308) (actual time=22.626..22.642 rows=237 loops=1)

  • Sort Key: vtp_1.heure_passage_theorique, t.nom_tournee, t.id_tournee_pc7, vt.version_tournee, vt.id_version_tournee, (count(vtp.id_version_tournee_point)), vtp_2.heure_passage_theorique, u.username, o.date, o_1.date, (count(vtpprogress.sequence)), tmp.date, tmp.date_reference, tmp.heure_passage_theorique, o_4.date, a_1.nom, pc.code_point, pc.raison_sociale, pc.ville, c.codeclient, c.nom
  • Sort Method: quicksort Memory: 59kB
3. 0.108 20.458 ↑ 1.0 237 1

Nested Loop Left Join (cost=194.48..47,206.68 rows=239 width=308) (actual time=0.730..20.458 rows=237 loops=1)

4. 0.112 16.795 ↑ 1.0 237 1

Nested Loop Left Join (cost=130.91..32,005.88 rows=239 width=160) (actual time=0.712..16.795 rows=237 loops=1)

5. 0.086 14.076 ↑ 1.0 237 1

Nested Loop Left Join (cost=95.56..23,552.45 rows=239 width=138) (actual time=0.695..14.076 rows=237 loops=1)

6. 0.153 11.857 ↑ 1.0 237 1

Nested Loop Left Join (cost=60.25..15,106.19 rows=239 width=130) (actual time=0.684..11.857 rows=237 loops=1)

7. 0.160 9.808 ↑ 1.0 237 1

Nested Loop Left Join (cost=56.68..14,246.99 rows=239 width=122) (actual time=0.669..9.808 rows=237 loops=1)

8. 0.100 7.041 ↑ 1.0 237 1

Nested Loop (cost=51.88..13,094.11 rows=239 width=64) (actual time=0.633..7.041 rows=237 loops=1)

9. 0.206 6.467 ↑ 1.0 237 1

Nested Loop (cost=51.46..12,637.61 rows=239 width=58) (actual time=0.629..6.467 rows=237 loops=1)

10. 0.043 5.787 ↑ 1.0 237 1

Nested Loop (cost=51.04..12,181.10 rows=239 width=52) (actual time=0.615..5.787 rows=237 loops=1)

11. 0.008 5.270 ↑ 1.0 237 1

Nested Loop (cost=50.76..12,089.78 rows=239 width=43) (actual time=0.606..5.270 rows=237 loops=1)

12. 0.237 4.788 ↑ 1.0 237 1

Nested Loop (cost=50.48..12,008.38 rows=239 width=24) (actual time=0.598..4.788 rows=237 loops=1)

13. 0.623 3.129 ↑ 1.0 237 1

Hash Join (cost=1.39..267.58 rows=239 width=16) (actual time=0.568..3.129 rows=237 loops=1)

  • Hash Cond: (vtd.id_agence = a.id_agence)
14. 2.495 2.495 ↑ 1.0 7,158 1

Seq Scan on version_tournee_dispo vtd (cost=0.00..236.96 rows=7,158 width=20) (actual time=0.010..2.495 rows=7,158 loops=1)

  • Filter: (date_reference = '2018-12-27 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 2759
15. 0.002 0.011 ↓ 2.0 2 1

Hash (cost=1.38..1.38 rows=1 width=4) (actual time=0.011..0.011 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
16. 0.009 0.009 ↓ 2.0 2 1

Seq Scan on agence a (cost=0.00..1.38 rows=1 width=4) (actual time=0.005..0.009 rows=2 loops=1)

  • Filter: (cp = 13)
  • Rows Removed by Filter: 28
17. 0.237 1.422 ↑ 1.0 1 237

Aggregate (cost=49.09..49.10 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=237)

18. 1.185 1.185 ↑ 2.4 14 237

Index Scan using id_version_tournee_id_client_index on version_tournee_point vtp (cost=0.42..49.01 rows=33 width=8) (actual time=0.002..0.005 rows=14 loops=237)

  • Index Cond: (id_version_tournee = vtd.id_version_tournee)
19. 0.474 0.474 ↑ 1.0 1 237

Index Scan using version_tournee_info_pkey on version_tournee vt (cost=0.28..0.33 rows=1 width=19) (actual time=0.001..0.002 rows=1 loops=237)

  • Index Cond: (id_version_tournee = vtd.id_version_tournee)
20. 0.474 0.474 ↑ 1.0 1 237

Index Scan using id_tournee_id_tournee_pc7_index on tournee t (cost=0.28..0.37 rows=1 width=17) (actual time=0.001..0.002 rows=1 loops=237)

  • Index Cond: (id_tournee = vt.id_tournee)
21. 0.000 0.474 ↑ 1.0 1 237

Limit (cost=0.42..1.89 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=237)

22. 0.474 0.474 ↑ 33.0 1 237

Index Scan using id_version_tournee_sequence_ukey on version_tournee_point vtp_1 (cost=0.42..49.01 rows=33 width=8) (actual time=0.002..0.002 rows=1 loops=237)

  • Index Cond: (id_version_tournee = vtd.id_version_tournee)
23. 0.000 0.474 ↑ 1.0 1 237

Limit (cost=0.42..1.89 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=237)

24. 0.474 0.474 ↑ 33.0 1 237

Index Scan Backward using id_version_tournee_sequence_ukey on version_tournee_point vtp_2 (cost=0.42..49.01 rows=33 width=8) (actual time=0.002..0.002 rows=1 loops=237)

  • Index Cond: (id_version_tournee = vtd.id_version_tournee)
25. 0.000 2.607 ↓ 0.0 0 237

Limit (cost=4.80..4.80 rows=1 width=58) (actual time=0.011..0.011 rows=0 loops=237)

26. 0.474 2.607 ↓ 0.0 0 237

Sort (cost=4.80..4.80 rows=1 width=58) (actual time=0.011..0.011 rows=0 loops=237)

  • Sort Key: o.date
  • Sort Method: quicksort Memory: 25kB
27. 0.453 2.133 ↓ 0.0 0 237

Hash Join (cost=3.57..4.79 rows=1 width=58) (actual time=0.009..0.009 rows=0 loops=237)

  • Hash Cond: (u.id_user = o.id_user)
28. 0.021 0.021 ↑ 1.2 13 7

Seq Scan on "user" u (cost=0.00..1.15 rows=15 width=54) (actual time=0.001..0.003 rows=13 loops=7)

29. 0.000 1.659 ↓ 0.0 0 237

Hash (cost=3.56..3.56 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=237)

  • Buckets: 1024 Batches: 1 Memory Usage: 0kB
30. 1.659 1.659 ↓ 0.0 0 237

Seq Scan on operation o (cost=0.00..3.56 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=237)

  • Filter: ((id_version_tournee = vtd.id_version_tournee) AND (id_action = 100) AND (date_reference = '2018-12-27 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 32
31. 0.000 1.896 ↓ 0.0 0 237

Limit (cost=3.57..3.57 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=237)

32. 0.237 1.896 ↓ 0.0 0 237

Sort (cost=3.57..3.57 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=237)

  • Sort Key: o_1.date
  • Sort Method: quicksort Memory: 25kB
33. 1.659 1.659 ↓ 0.0 0 237

Seq Scan on operation o_1 (cost=0.00..3.56 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=237)

  • Filter: ((id_version_tournee = vtd.id_version_tournee) AND (id_action = 101) AND (date_reference = '2018-12-27 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 32
34. 0.237 2.133 ↑ 1.0 1 237

Aggregate (cost=35.31..35.32 rows=1 width=2) (actual time=0.009..0.009 rows=1 loops=237)

35. 0.000 1.896 ↓ 0.0 0 237

HashAggregate (cost=35.20..35.25 rows=5 width=10) (actual time=0.008..0.008 rows=0 loops=237)

36. 0.189 1.896 ↓ 0.0 0 237

Nested Loop (cost=0.29..35.17 rows=5 width=10) (actual time=0.007..0.008 rows=0 loops=237)

37. 1.659 1.659 ↓ 0.0 0 237

Seq Scan on operation o_2 (cost=0.00..3.56 rows=5 width=16) (actual time=0.007..0.007 rows=0 loops=237)

  • Filter: ((id_version_tournee = vtd.id_version_tournee) AND (id_action = 4) AND (date_reference = '2018-12-27 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 32
38. 0.048 0.048 ↑ 1.0 1 48

Index Scan using version_tournee_point_pkey on version_tournee_point vtpprogress (cost=0.29..6.31 rows=1 width=10) (actual time=0.001..0.001 rows=1 loops=48)

  • Index Cond: (id_version_tournee_point = o_2.id_version_tournee_point)
39. 0.000 2.607 ↓ 0.0 0 237

Limit (cost=35.35..35.35 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=237)

40. 0.237 2.607 ↓ 0.0 0 237

Sort (cost=35.35..35.36 rows=5 width=24) (actual time=0.011..0.011 rows=0 loops=237)

  • Sort Key: tmp.sequence
  • Sort Method: quicksort Memory: 25kB
41. 0.237 2.370 ↓ 0.0 0 237

Subquery Scan on tmp (cost=35.22..35.32 rows=5 width=24) (actual time=0.010..0.010 rows=0 loops=237)

42. 0.000 2.133 ↓ 0.0 0 237

HashAggregate (cost=35.22..35.27 rows=5 width=24) (actual time=0.009..0.009 rows=0 loops=237)

43. 0.189 2.133 ↓ 0.0 0 237

Nested Loop (cost=0.29..35.17 rows=5 width=24) (actual time=0.008..0.009 rows=0 loops=237)

44. 1.896 1.896 ↓ 0.0 0 237

Seq Scan on operation o_3 (cost=0.00..3.56 rows=5 width=24) (actual time=0.008..0.008 rows=0 loops=237)

  • Filter: ((id_version_tournee = vtd.id_version_tournee) AND (id_action = 1) AND (date_reference = '2018-12-27 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 32
45. 0.048 0.048 ↑ 1.0 1 48

Index Scan using version_tournee_point_pkey on version_tournee_point vtplastpoint (cost=0.29..6.31 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=48)

  • Index Cond: (id_version_tournee_point = o_3.id_version_tournee_point)
46. 0.000 3.555 ↓ 0.0 0 237

Limit (cost=63.58..63.58 rows=1 width=156) (actual time=0.015..0.015 rows=0 loops=237)

47. 0.474 3.555 ↓ 0.0 0 237

Sort (cost=63.58..63.58 rows=1 width=156) (actual time=0.015..0.015 rows=0 loops=237)

  • Sort Key: o_4.date
  • Sort Method: quicksort Memory: 25kB
48. 0.135 3.081 ↓ 0.0 0 237

Nested Loop (cost=0.70..63.57 rows=1 width=156) (actual time=0.009..0.013 rows=0 loops=237)

49. 0.372 2.844 ↓ 0.0 0 237

Nested Loop (cost=0.42..63.25 rows=1 width=134) (actual time=0.008..0.012 rows=0 loops=237)

  • Join Filter: (o_4.id_action = a_1.id_action)
  • Rows Removed by Join Filter: 6
50. 0.066 2.370 ↓ 0.0 0 237

Nested Loop (cost=0.42..61.89 rows=1 width=56) (actual time=0.008..0.010 rows=0 loops=237)

51. 1.896 1.896 ↓ 0.0 0 237

Seq Scan on operation o_4 (cost=0.00..3.80 rows=9 width=23) (actual time=0.008..0.008 rows=0 loops=237)

  • Filter: ((id_version_tournee = vtd.id_version_tournee) AND (date_reference = '2018-12-27 00:00:00'::timestamp without time zone) AND ((id_action = 1) OR (id_action = 4) OR (id_action = 100) OR (id_action = 101)))
  • Rows Removed by Filter: 32
52. 0.408 0.408 ↑ 1.0 1 102

Index Scan using id_client_code_point_index on point_client pc (cost=0.42..6.44 rows=1 width=40) (actual time=0.003..0.004 rows=1 loops=102)

  • Index Cond: ((id_client = o_4.id_client) AND ((code_point)::text = (o_4.code_point)::text))
53. 0.102 0.102 ↑ 1.0 16 102

Seq Scan on action a_1 (cost=0.00..1.16 rows=16 width=86) (actual time=0.000..0.001 rows=16 loops=102)

54. 0.102 0.102 ↑ 1.0 1 102

Index Scan using client_pkey on client c (cost=0.28..0.30 rows=1 width=34) (actual time=0.001..0.001 rows=1 loops=102)

  • Index Cond: (id_client = pc.id_client)