explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q8Vb

Settings
# exclusive inclusive rows x rows loops node
1. 3.113 1,040.133 ↓ 1.5 28,854 1

Limit (cost=28,573.97..209,919.17 rows=19,079 width=2,487) (actual time=367.085..1,040.133 rows=28,854 loops=1)

2. 31.199 1,037.020 ↓ 1.5 28,854 1

Nested Loop Left Join (cost=28,573.97..209,919.17 rows=19,079 width=2,487) (actual time=367.083..1,037.020 rows=28,854 loops=1)

3. 17.922 948.113 ↓ 1.5 28,854 1

Hash Left Join (cost=28,573.53..147,229.00 rows=19,079 width=1,990) (actual time=367.046..948.113 rows=28,854 loops=1)

  • Hash Cond: (patient5_.osnov_osiguruvanje_id = insurancet6_.id)
4. 76.365 930.168 ↓ 1.5 28,854 1

Hash Left Join (cost=28,571.99..146,986.69 rows=19,079 width=1,842) (actual time=366.991..930.168 rows=28,854 loops=1)

  • Hash Cond: (this_.medic_info_id = medicinfo4_.id)
5. 74.664 746.665 ↓ 1.5 28,854 1

Hash Left Join (cost=19,760.51..137,793.62 rows=19,079 width=1,688) (actual time=259.661..746.665 rows=28,854 loops=1)

  • Hash Cond: (this_.institution_info_id = institutio3_.id)
6. 33.114 554.664 ↓ 1.5 28,854 1

Nested Loop Left Join (cost=9,755.99..127,431.38 rows=19,079 width=1,470) (actual time=142.145..554.664 rows=28,854 loops=1)

7. 167.486 348.426 ↓ 1.5 28,854 1

Hash Join (cost=9,755.56..21,010.74 rows=19,079 width=973) (actual time=142.106..348.426 rows=28,854 loops=1)

  • Hash Cond: (patientinf1_.id = this_.patient_info_id)
8. 39.019 39.019 ↑ 1.0 180,580 1

Seq Scan on health_reg_patient_info patientinf1_ (cost=0.00..8,546.32 rows=183,132 width=307) (actual time=0.019..39.019 rows=180,580 loops=1)

9. 38.271 141.921 ↓ 1.5 28,857 1

Hash (cost=9,517.08..9,517.08 rows=19,079 width=666) (actual time=141.921..141.921 rows=28,857 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 10034kB
10. 103.650 103.650 ↓ 1.5 28,857 1

Seq Scan on health_reg_diabetes_medical_data this_ (cost=0.00..9,517.08 rows=19,079 width=666) (actual time=0.015..103.650 rows=28,857 loops=1)

  • Filter: ((register_status = ANY ('{4,5}'::integer[])) AND (register_date >= '2018-01-01 00:00:00'::timestamp without time zone) AND (register_date < '2019-01-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 138990
11. 173.124 173.124 ↑ 1.0 1 28,854

Index Scan using ix_patients_id on health_patients patient5_ (cost=0.43..5.57 rows=1 width=497) (actual time=0.006..0.006 rows=1 loops=28,854)

  • Index Cond: (this_.patient_id = id)
12. 72.694 117.337 ↑ 1.0 174,518 1

Hash (cost=7,812.56..7,812.56 rows=175,356 width=218) (actual time=117.337..117.337 rows=174,518 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 32998kB
13. 44.643 44.643 ↑ 1.0 174,518 1

Seq Scan on health_institution_info institutio3_ (cost=0.00..7,812.56 rows=175,356 width=218) (actual time=0.009..44.643 rows=174,518 loops=1)

14. 68.769 107.138 ↓ 1.0 211,244 1

Hash (cost=6,208.44..6,208.44 rows=208,244 width=154) (actual time=107.138..107.138 rows=211,244 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 29510kB
15. 38.369 38.369 ↓ 1.0 211,244 1

Seq Scan on health_reg_medic_info medicinfo4_ (cost=0.00..6,208.44 rows=208,244 width=154) (actual time=0.008..38.369 rows=211,244 loops=1)

16. 0.011 0.023 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=148) (actual time=0.023..0.023 rows=24 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
17. 0.012 0.012 ↑ 1.0 24 1

Seq Scan on health_insurance_types insurancet6_ (cost=0.00..1.24 rows=24 width=148) (actual time=0.011..0.012 rows=24 loops=1)

18. 57.708 57.708 ↑ 1.0 1 28,854

Index Scan using ix_patients_id on health_patients patient8_ (cost=0.43..3.28 rows=1 width=497) (actual time=0.002..0.002 rows=1 loops=28,854)

  • Index Cond: (patientinf1_.patient_id = id)