explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4sBQ : master query

Settings
# exclusive inclusive rows x rows loops node
1. 0.092 293.465 ↓ 4.9 201 1

GroupAggregate (cost=127,716.08..127,789.78 rows=41 width=282) (actual time=293.368..293.465 rows=201 loops=1)

  • Group Key: (nama((ph.idpemilik)::integer)), h1.identifikasi, h2.identifikasi, (nama(lh.createdby)), lh.id, (tanggal(lh.createdon)), (tanggal((h2.tanggallahir)::timestamp without time zone)), (get_location_rev(u.locationid)), (local_phone((u.phone)::character varying)), (get_species_name(h1.idspesies, 1301)), (sx.name[1])
2. 0.338 293.373 ↓ 4.9 201 1

Sort (cost=127,716.08..127,716.19 rows=41 width=274) (actual time=293.363..293.373 rows=201 loops=1)

  • Sort Key: (nama((ph.idpemilik)::integer)), h1.identifikasi, h2.identifikasi, (nama(lh.createdby)), lh.id, (tanggal(lh.createdon)), (tanggal((h2.tanggallahir)::timestamp without time zone)), (get_location_rev(u.locationid)), (local_phone((u.phone)::character varying)), (get_species_name(h1.idspesies, 1301)), (sx.name[1])
  • Sort Method: quicksort Memory: 78kB
3. 19.580 293.035 ↓ 4.9 201 1

Hash Left Join (cost=64,115.37..127,714.99 rows=41 width=274) (actual time=163.433..293.035 rows=201 loops=1)

  • Hash Cond: (h2.idsex = sx.id)
4. 0.200 273.444 ↓ 4.9 201 1

Nested Loop Left Join (cost=64,114.30..127,641.70 rows=41 width=67) (actual time=163.141..273.444 rows=201 loops=1)

5. 0.169 272.641 ↓ 4.9 201 1

Nested Loop (cost=64,113.86..127,331.07 rows=41 width=57) (actual time=163.131..272.641 rows=201 loops=1)

  • Join Filter: (lh.idhewan = h1.id)
6. 28.693 271.668 ↓ 4.8 201 1

Hash Join (cost=64,113.42..127,308.58 rows=42 width=62) (actual time=163.119..271.668 rows=201 loops=1)

  • Hash Cond: (lh.idhewan = ph.idhewan)
  • Join Filter: ((lh.createdon > ph.tanggalmulai) AND ((lh.reportdate < ph.tanggalakhir) OR (ph.tanggalakhir IS NULL)))
7. 80.297 80.297 ↓ 6.1 158,632 1

Index Scan using kejadian_tipe_date_del on kejadian lh (cost=0.56..63,096.92 rows=25,835 width=37) (actual time=0.020..80.297 rows=158,632 loops=1)

  • Index Cond: (((createdon)::date >= '2019-09-01'::date) AND ((createdon)::date <= '2019-09-30'::date) AND (idtipekejadian = 1))
8. 10.975 162.678 ↑ 1.4 58,537 1

Hash (cost=63,069.06..63,069.06 rows=83,504 width=49) (actual time=162.678..162.678 rows=58,537 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 5,253kB
9. 7.497 151.703 ↑ 1.4 58,537 1

Nested Loop (cost=1.16..63,069.06 rows=83,504 width=49) (actual time=0.527..151.703 rows=58,537 loops=1)

10. 1.234 65.378 ↑ 2.7 13,138 1

Nested Loop (cost=0.72..29,040.89 rows=36,025 width=21) (actual time=0.519..65.378 rows=13,138 loops=1)

11. 36.011 50.758 ↑ 2.3 194 1

Nested Loop (cost=0.29..19,710.16 rows=437 width=4) (actual time=0.507..50.758 rows=194 loops=1)

  • Join Filter: ((l1.code)::text ~ ('^'::text || (l2.code)::text))
  • Rows Removed by Join Filter: 87,243
12. 0.006 0.006 ↑ 1.0 1 1

Index Scan using locations_pkey on locations l2 (cost=0.29..8.31 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (id = ANY ('{323}'::integer[]))
13. 14.741 14.741 ↓ 1.0 87,437 1

Seq Scan on locations l1 (cost=0.00..18,390.94 rows=87,394 width=12) (actual time=0.003..14.741 rows=87,437 loops=1)

14. 13.386 13.386 ↑ 7.2 68 194

Index Scan using users_locationid on users u (cost=0.43..16.45 rows=490 width=21) (actual time=0.004..0.069 rows=68 loops=194)

  • Index Cond: (locationid = l1.id)
  • Filter: (NOT del)
  • Rows Removed by Filter: 0
15. 78.828 78.828 ↑ 3.0 4 13,138

Index Scan using ph_idpemilik_ix on pemilik_hewan ph (cost=0.44..0.82 rows=12 width=32) (actual time=0.003..0.006 rows=4 loops=13,138)

  • Index Cond: (idpemilik = u.id)
  • Filter: (NOT del)
  • Rows Removed by Filter: 0
16. 0.804 0.804 ↑ 1.0 1 201

Index Scan using hewan_pkey on hewan h1 (cost=0.44..0.52 rows=1 width=15) (actual time=0.004..0.004 rows=1 loops=201)

  • Index Cond: (id = ph.idhewan)
  • Filter: (NOT del)
17. 0.603 0.603 ↑ 1.0 1 201

Index Scan using hewan_pkey on hewan h2 (cost=0.44..7.58 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=201)

  • Index Cond: (id = (lh.datakejadian)::integer)
18. 0.006 0.011 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=53) (actual time=0.011..0.011 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 0.005 0.005 ↑ 1.0 3 1

Seq Scan on sex sx (cost=0.00..1.03 rows=3 width=53) (actual time=0.004..0.005 rows=3 loops=1)

Planning time : 1.680 ms
Execution time : 293.604 ms