explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o7Tz

Settings
# exclusive inclusive rows x rows loops node
1. 59.196 1,297.473 ↓ 3.8 77,848 1

Gather (cost=181,268.05..242,524.76 rows=20,390 width=19) (actual time=950.189..1,297.473 rows=77,848 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 114.909 1,238.277 ↓ 3.1 25,949 3

Nested Loop Left Join (cost=180,268.05..239,485.76 rows=8,496 width=19) (actual time=934.139..1,238.277 rows=25,949 loops=3)

3. 169.550 1,123.365 ↓ 3.1 25,949 3

Nested Loop Left Join (cost=180,268.05..195,877.96 rows=8,496 width=23) (actual time=934.075..1,123.365 rows=25,949 loops=3)

4. 13.882 953.809 ↓ 3.1 25,949 3

Merge Join (cost=180,267.62..180,395.11 rows=8,496 width=27) (actual time=934.020..953.809 rows=25,949 loops=3)

  • Merge Cond: (band.tipo_evento_transaccion_id = tipo.id)
5. 24.587 939.846 ↓ 3.1 25,949 3

Sort (cost=180,265.99..180,287.23 rows=8,496 width=27) (actual time=933.928..939.846 rows=25,949 loops=3)

  • Sort Key: band.tipo_evento_transaccion_id
  • Sort Method: quicksort Memory: 2855kB
  • Worker 0: Sort Method: quicksort Memory: 2755kB
  • Worker 1: Sort Method: quicksort Memory: 2777kB
6. 12.660 915.259 ↓ 3.1 25,949 3

Hash Join (cost=101,718.94..179,711.51 rows=8,496 width=27) (actual time=583.186..915.259 rows=25,949 loops=3)

  • Hash Cond: (etiep.estado_solicitud_item_id = esi.id)
7. 27.573 902.532 ↓ 3.1 25,949 3

Parallel Hash Join (cost=101,717.63..179,681.14 rows=8,496 width=31) (actual time=582.923..902.532 rows=25,949 loops=3)

  • Hash Cond: (proc.beneficiario_id = bene.id)
8. 112.183 824.694 ↓ 3.1 25,949 3

Nested Loop (cost=98,470.52..176,411.74 rows=8,496 width=35) (actual time=530.420..824.694 rows=25,949 loops=3)

9. 113.408 712.507 ↓ 2.9 25,739 3

Nested Loop (cost=98,470.10..161,405.54 rows=8,753 width=35) (actual time=530.382..712.507 rows=25,739 loops=3)

  • Join Filter: (aso.id = eti.evento_transaccion_id)
10. 170.064 599.094 ↑ 1.2 20,731 3

Parallel Hash Join (cost=98,469.67..117,275.91 rows=24,505 width=35) (actual time=530.306..599.094 rows=20,731 loops=3)

  • Hash Cond: (aso.id = band.id)
11. 91.085 91.085 ↑ 1.2 510,317 3

Parallel Index Only Scan using ix_ambulatorio_solicitud_id on ambulatorio_solicitud aso (cost=0.43..16,312.45 rows=637,896 width=4) (actual time=0.097..91.085 rows=510,317 loops=3)

  • Heap Fetches: 82
12. 52.288 337.945 ↑ 1.0 78,476 3

Parallel Hash (cost=97,444.94..97,444.94 rows=81,944 width=31) (actual time=337.945..337.945 rows=78,476 loops=3)

  • Buckets: 262144 Batches: 1 Memory Usage: 17024kB
13. 270.491 285.657 ↑ 1.0 78,476 3

Nested Loop (cost=0.99..97,444.94 rows=81,944 width=31) (actual time=0.334..285.657 rows=78,476 loops=3)

14. 15.162 15.162 ↑ 1.2 56,486 3

Parallel Index Only Scan using idx_proceso_transaccion_fecha_bene on proceso_transaccion proc (cost=0.43..2,816.05 rows=65,532 width=8) (actual time=0.200..15.162 rows=56,486 loops=3)

  • Index Cond: ((fecha_proceso_transaccion >= '2019-01-01 00:00:00'::timestamp without time zone) AND (fecha_proceso_transaccion <= '2019-01-31 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
15. 0.004 0.004 ↑ 3.0 1 169,459

Index Only Scan using idx_evento_transaccion_delete_false on evento_transaccion band (cost=0.56..1.41 rows=3 width=31) (actual time=0.004..0.004 rows=1 loops=169,459)

  • Index Cond: (proceso_transaccion_id = proc.id)
  • Heap Fetches: 0
16. 0.005 0.005 ↑ 3.0 1 62,193

Index Scan using ix_evento_transaccion_item_evento_transaccion_id on evento_transaccion_item eti (cost=0.43..1.76 rows=3 width=8) (actual time=0.004..0.005 rows=1 loops=62,193)

  • Index Cond: (evento_transaccion_id = band.id)
  • Filter: ((deleted IS FALSE) AND (es_anulado IS FALSE))
17. 0.004 0.004 ↑ 1.0 1 77,216

Index Scan using idx_evento_transaccion_item_ep_evento_estado on evento_transaccion_item_estado_parcial etiep (cost=0.43..1.70 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=77,216)

  • Index Cond: (evento_transaccion_item_id = eti.id)
  • Filter: ((deleted IS FALSE) AND (es_anulado IS FALSE))
18. 28.595 50.265 ↑ 1.2 50,143 3

Parallel Hash (cost=2,463.63..2,463.63 rows=62,678 width=4) (actual time=50.265..50.265 rows=50,143 loops=3)

  • Buckets: 262144 Batches: 1 Memory Usage: 7968kB
19. 21.670 21.670 ↑ 1.2 50,143 3

Parallel Index Only Scan using pk_beneficiario on beneficiario bene (cost=0.42..2,463.63 rows=62,678 width=4) (actual time=0.060..21.670 rows=50,143 loops=3)

  • Heap Fetches: 0
20. 0.015 0.067 ↑ 1.0 14 3

Hash (cost=1.14..1.14 rows=14 width=4) (actual time=0.066..0.067 rows=14 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.052 0.052 ↑ 1.0 14 3

Seq Scan on estado_solicitud_item esi (cost=0.00..1.14 rows=14 width=4) (actual time=0.046..0.052 rows=14 loops=3)

22. 0.025 0.081 ↑ 1.1 17 3

Sort (cost=1.59..1.64 rows=19 width=4) (actual time=0.079..0.081 rows=17 loops=3)

  • Sort Key: tipo.id
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
23. 0.056 0.056 ↑ 1.0 19 3

Seq Scan on tipo_evento_transaccion tipo (cost=0.00..1.19 rows=19 width=4) (actual time=0.052..0.056 rows=19 loops=3)

24. 0.006 0.006 ↓ 0.0 0 77,848

Index Scan using ix_evento_transaccion_proceso_transaccion_id on evento_transaccion etorig (cost=0.43..1.81 rows=1 width=12) (actual time=0.006..0.006 rows=0 loops=77,848)

  • Index Cond: (proceso_transaccion_id = band.proceso_transaccion_id)
  • Filter: ((evento_transaccion_original_id IS NULL) AND (tipo_evento_transaccion_id = ANY ('{17,12}'::integer[])) AND (id <> band.id) AND (tipo_evento_transaccion_id = band.tipo_evento_transaccion_id))
  • Rows Removed by Filter: 2
25. 0.003 0.003 ↓ 0.0 0 77,848

Append (cost=0.00..5.06 rows=7 width=4) (actual time=0.003..0.003 rows=0 loops=77,848)

26. 0.000 0.000 ↓ 0.0 0 77,848

Seq Scan on ticket torig (cost=0.00..0.00 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Filter: (evento_transaccion_id = etorig.id)
27. 0.000 0.000 ↓ 0.0 0 77,848

Index Only Scan using ix_ticket_2015_evento_transaccion on ticket_2015 torig_1 (cost=0.15..0.76 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Index Cond: (evento_transaccion_id = etorig.id)
  • Heap Fetches: 0
28. 0.000 0.000 ↓ 0.0 0 77,848

Index Only Scan using ix_ticket_2016_evento_transaccion on ticket_2016 torig_2 (cost=0.29..0.91 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Index Cond: (evento_transaccion_id = etorig.id)
  • Heap Fetches: 0
29. 0.000 0.000 ↓ 0.0 0 77,848

Index Only Scan using ix_ticket_2017_evento_transaccion on ticket_2017 torig_3 (cost=0.43..1.07 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Index Cond: (evento_transaccion_id = etorig.id)
  • Heap Fetches: 0
30. 0.000 0.000 ↓ 0.0 0 77,848

Index Only Scan using ix_ticket_2018_evento_transaccion on ticket_2018 torig_4 (cost=0.43..1.08 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Index Cond: (evento_transaccion_id = etorig.id)
  • Heap Fetches: 0
31. 0.000 0.000 ↓ 0.0 0 77,848

Index Only Scan using ix_ticket_2019_evento_transaccion on ticket_2019 torig_5 (cost=0.43..1.07 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Index Cond: (evento_transaccion_id = etorig.id)
  • Heap Fetches: 0
32. 0.000 0.000 ↓ 0.0 0 77,848

Index Only Scan using ix_ticket_otros_evento_transaccion on ticket_otros torig_6 (cost=0.13..0.14 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=77,848)

  • Index Cond: (evento_transaccion_id = etorig.id)
  • Heap Fetches: 0
Planning time : 17.871 ms
Execution time : 1,303.709 ms