explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LYba : Optimization for: plan #edyV

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1,392.399 1,392.399 ↑ 1.0 14,473 1

CTE Scan on two (cost=70,227.69..70,519.21 rows=14,576 width=112) (actual time=1,093.982..1,392.399 rows=14,473 loops=1)

2.          

CTE one

3. 58.939 106.212 ↑ 1.0 14,473 1

Hash Join (cost=1.58..1,100.81 rows=14,576 width=46) (actual time=0.219..106.212 rows=14,473 loops=1)

  • Hash Cond: (doc_management_request_az.zags_list_azkind_id = zags_list_azkind.zags_list_azkind_id)
4. 47.170 47.170 ↑ 1.0 14,473 1

Index Scan using doc_management_request_request_id on doc_management_request_az (cost=0.42..934.11 rows=14,576 width=24) (actual time=0.086..47.170 rows=14,473 loops=1)

  • Index Cond: (doc_management_request_id = 550)
  • Filter: (az_is_found AND (zags_az_id IS NOT NULL))
5. 0.035 0.103 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=38) (actual time=0.103..0.103 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.068 0.068 ↑ 1.0 7 1

Seq Scan on zags_list_azkind (cost=0.00..1.07 rows=7 width=38) (actual time=0.015..0.068 rows=7 loops=1)

7.          

CTE two

8. 341.154 1,168.960 ↑ 1.0 14,473 1

Sort (cost=69,090.44..69,126.88 rows=14,576 width=2,343) (actual time=1,093.966..1,168.960 rows=14,473 loops=1)

  • Sort Key: zags_az.az_date DESC
  • Sort Method: external merge Disk: 29520kB
9. 166.017 827.806 ↑ 1.0 14,473 1

Hash Join (cost=47,732.47..53,333.41 rows=14,576 width=2,343) (actual time=493.472..827.806 rows=14,473 loops=1)

  • Hash Cond: (one.zags_az_id = zags_az.zags_az_id)
10. 168.634 168.634 ↑ 1.0 14,473 1

CTE Scan on one (cost=0.00..291.52 rows=14,576 width=48) (actual time=0.226..168.634 rows=14,473 loops=1)

11. 246.032 493.155 ↓ 1.0 17,251 1

Hash (cost=42,667.36..42,667.36 rows=17,129 width=2,291) (actual time=493.155..493.155 rows=17,251 loops=1)

  • Buckets: 16384 Batches: 2 Memory Usage: 17482kB
12. 32.823 247.123 ↓ 1.0 17,251 1

Gather (cost=1,000.42..42,667.36 rows=17,129 width=2,291) (actual time=4.178..247.123 rows=17,251 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
13. 153.610 214.300 ↑ 1.2 8,626 2

Nested Loop (cost=0.42..39,954.46 rows=10,076 width=2,291) (actual time=0.476..214.300 rows=8,626 loops=2)

14. 60.680 60.680 ↑ 1.2 8,626 2

Parallel Seq Scan on zags_az (cost=0.00..2,894.76 rows=10,076 width=922) (actual time=0.043..60.680 rows=8,626 loops=2)

15. 0.010 0.010 ↑ 1.0 1 17,251

Index Scan using government_list_body_pkey on government_list_body (cost=0.42..3.68 rows=1 width=1,369) (actual time=0.010..0.010 rows=1 loops=17,251)

  • Index Cond: (government_list_body_id = zags_az.az_first_gov_list_body_id)