explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ho3n

Settings
# exclusive inclusive rows x rows loops node
1. 57.810 750.521 ↓ 1.0 34,300 1

Nested Loop Left Join (cost=1,298.06..1,181,850.93 rows=33,912 width=292) (actual time=22.598..750.521 rows=34,300 loops=1)

2. 24.320 246.811 ↓ 1.0 34,300 1

Nested Loop Left Join (cost=1,287.88..355,208.25 rows=33,912 width=199) (actual time=22.440..246.811 rows=34,300 loops=1)

3. 15.967 85.291 ↓ 1.0 34,300 1

Hash Left Join (cost=1,277.53..2,817.69 rows=33,912 width=167) (actual time=22.391..85.291 rows=34,300 loops=1)

  • Hash Cond: ((pm.tpprovee)::text = (pt.tpprovee)::text)
4. 26.655 69.247 ↓ 1.0 34,300 1

Hash Left Join (cost=1,274.82..2,721.00 rows=33,912 width=161) (actual time=22.283..69.247 rows=34,300 loops=1)

  • Hash Cond: (((b.cdama)::text = (pm.cdama)::text) AND ((b.cdprovee)::text = (pm.cdprovee)::text))
5. 20.436 20.436 ↓ 1.0 34,300 1

Seq Scan on base b (cost=0.00..1,268.12 rows=33,912 width=113) (actual time=0.011..20.436 rows=34,300 loops=1)

6. 10.023 22.156 ↑ 1.0 33,534 1

Hash (cost=771.53..771.53 rows=33,553 width=48) (actual time=22.156..22.156 rows=33,534 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2889kB
7. 12.133 12.133 ↑ 1.0 33,534 1

Seq Scan on proveedor_manual pm (cost=0.00..771.53 rows=33,553 width=48) (actual time=0.020..12.133 rows=33,534 loops=1)

8. 0.037 0.077 ↓ 1.1 85 1

Hash (cost=1.76..1.76 rows=76 width=14) (actual time=0.077..0.077 rows=85 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
9. 0.040 0.040 ↓ 1.1 85 1

Seq Scan on proveedor_tipo pt (cost=0.00..1.76 rows=76 width=14) (actual time=0.021..0.040 rows=85 loops=1)

10. 0.000 137.200 ↓ 0.0 0 34,300

GroupAggregate (cost=10.34..10.37 rows=1 width=51) (actual time=0.004..0.004 rows=0 loops=34,300)

  • Group Key: a.cdama, a.cdprovee, a.cdusuario
11. 34.300 137.200 ↓ 0.0 0 34,300

Sort (cost=10.34..10.35 rows=1 width=23) (actual time=0.004..0.004 rows=0 loops=34,300)

  • Sort Key: a.cdusuario
  • Sort Method: quicksort Memory: 25kB
12. 34.263 102.900 ↓ 0.0 0 34,300

Nested Loop Left Join (cost=0.14..10.33 rows=1 width=23) (actual time=0.003..0.003 rows=0 loops=34,300)

13. 68.600 68.600 ↓ 0.0 0 34,300

Seq Scan on asignacion a (cost=0.00..1.23 rows=1 width=23) (actual time=0.002..0.002 rows=0 loops=34,300)

  • Filter: ((cdusuario IS NULL) AND ((cdama)::text = (pm.cdama)::text) AND ((cdprovee)::text = (pm.cdprovee)::text) AND ((cdbase)::text = (b.cdbase)::text))
  • Rows Removed by Filter: 13
14. 0.037 0.037 ↑ 1.0 1 1

Index Scan using unique_siniestro on siniestro s (cost=0.14..8.16 rows=1 width=11) (actual time=0.037..0.037 rows=1 loops=1)

  • Index Cond: (((cdama)::text = (a.cdama)::text) AND ((cdama)::text = (pm.cdama)::text) AND (rgpresta = a.rgpresta))
15. 34.300 137.200 ↓ 0.0 0 34,300

GroupAggregate (cost=10.19..10.21 rows=1 width=42) (actual time=0.004..0.004 rows=0 loops=34,300)

  • Group Key: s_1.cdama, asig.cdprovee
16. 0.000 102.900 ↓ 0.0 0 34,300

Sort (cost=10.19..10.19 rows=1 width=14) (actual time=0.003..0.003 rows=0 loops=34,300)

  • Sort Key: s_1.cdama
  • Sort Method: quicksort Memory: 25kB
17. 34.270 102.900 ↓ 0.0 0 34,300

Nested Loop Left Join (cost=0.28..10.18 rows=1 width=14) (actual time=0.003..0.003 rows=0 loops=34,300)

18. 68.600 68.600 ↓ 0.0 0 34,300

Seq Scan on asignacion asig (cost=0.00..1.23 rows=1 width=14) (actual time=0.002..0.002 rows=0 loops=34,300)

  • Filter: ((cdusuario IS NULL) AND ((cdama)::text = (pm.cdama)::text) AND ((cdprovee)::text = (pm.cdprovee)::text) AND ((cdbase)::text = (b.cdbase)::text))
  • Rows Removed by Filter: 13
19. 0.006 0.030 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.28..8.94 rows=1 width=11) (actual time=0.029..0.030 rows=1 loops=1)

20. 0.009 0.009 ↑ 1.0 1 1

Index Scan using unique_siniestro on siniestro s_1 (cost=0.14..8.16 rows=1 width=11) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (((cdama)::text = (asig.cdama)::text) AND ((cdama)::text = (pm.cdama)::text) AND (rgpresta = asig.rgpresta))
21. 0.015 0.015 ↑ 1.0 1 1

Index Only Scan using cliente_pk on cliente cli (cost=0.14..0.66 rows=1 width=7) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: ((cdcliente = s_1.cdcliente) AND (cdama = (s_1.cdama)::text) AND (cdama = (pm.cdama)::text))
  • Heap Fetches: 0
22.          

SubPlan (for Nested Loop Left Join)

23. 34.300 137.200 ↓ 0.0 0 34,300

HashSetOp Except (cost=0.00..4.54 rows=100 width=36) (actual time=0.004..0.004 rows=0 loops=34,300)

24. 0.000 102.900 ↑ 50.0 4 34,300

Append (cost=0.00..4.04 rows=200 width=36) (actual time=0.001..0.003 rows=4 loops=34,300)

25. 34.300 34.300 ↓ 0.0 0 34,300

Subquery Scan on *SELECT* 1 (cost=0.00..1.52 rows=100 width=36) (actual time=0.001..0.001 rows=0 loops=34,300)

26. 0.000 0.000 ↓ 0.0 0 34,300

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.000..0.000 rows=0 loops=34,300)

27. 0.000 0.000 ↑ 1.0 1 34,300

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=34,300)

28. 34.300 68.600 ↑ 25.0 4 34,300

Subquery Scan on *SELECT* 2 (cost=0.00..1.52 rows=100 width=36) (actual time=0.001..0.002 rows=4 loops=34,300)

29. 34.300 34.300 ↑ 25.0 4 34,300

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.000..0.001 rows=4 loops=34,300)

30. 0.000 0.000 ↑ 1.0 1 34,300

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=34,300)

31. 34.300 102.900 ↓ 0.0 0 34,300

GroupAggregate (cost=0.00..1.26 rows=1 width=51) (actual time=0.003..0.003 rows=0 loops=34,300)

  • Group Key: a_1.cdama, a_1.cdprovee, a_1.cdbase
32. 68.600 68.600 ↓ 0.0 0 34,300

Seq Scan on asignacion a_1 (cost=0.00..1.23 rows=1 width=23) (actual time=0.002..0.002 rows=0 loops=34,300)

  • Filter: ((cdusuario IS NULL) AND ((cdama)::text = (pm.cdama)::text) AND ((cdprovee)::text = (pm.cdprovee)::text) AND ((cdbase)::text = (b.cdbase)::text))
  • Rows Removed by Filter: 13
33. 0.000 68.600 ↓ 0.0 0 34,300

GroupAggregate (cost=0.27..8.31 rows=1 width=41) (actual time=0.002..0.002 rows=0 loops=34,300)

  • Group Key: pmov.cdama, pmov.cdprovee
34. 68.600 68.600 ↓ 0.0 0 34,300

Index Only Scan using unique_proveedor_movil on proveedor_movil pmov (cost=0.27..8.29 rows=1 width=17) (actual time=0.002..0.002 rows=0 loops=34,300)

  • Index Cond: ((cdama = (pm.cdama)::text) AND (cdprovee = (pm.cdprovee)::text))
  • Heap Fetches: 92
Planning time : 1.270 ms
Execution time : 753.225 ms