explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KMPb

Settings
# exclusive inclusive rows x rows loops node
1. 1.201 1.201 ↑ 1,850,327.9 63 1

CTE Scan on tmp_logs (cost=41,988,618.02..44,320,031.18 rows=116,570,658 width=208) (actual time=1.030..1.201 rows=63 loops=1)

2.          

CTE args

3. 0.607 0.607 ↑ 1.0 1 1

Seq Scan on sites (cost=0.00..1.26 rows=1 width=64) (actual time=0.606..0.607 rows=1 loops=1)

4.          

CTE process_ids

5. 0.116 0.728 ↓ 1.7 5 1

Seq Scan on processes (cost=0.02..9.22 rows=3 width=16) (actual time=0.636..0.728 rows=5 loops=1)

  • Filter: (name = $1)
  • Rows Removed by Filter: 348
6.          

Initplan (for Seq Scan)

7. 0.612 0.612 ↑ 1.0 1 1

CTE Scan on args (cost=0.00..0.02 rows=1 width=32) (actual time=0.610..0.612 rows=1 loops=1)

8.          

CTE tmp_sn

9. 0.001 1.013 ↑ 9,033.0 2 1

Unique (cost=339,304.78..339,485.44 rows=18,066 width=28) (actual time=1.009..1.013 rows=2 loops=1)

10.          

Initplan (for Unique)

11. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on args args_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=1)

12. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on args args_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

13. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on args args_3 (cost=0.00..0.02 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=1)

14. 0.017 1.008 ↑ 9,033.0 2 1

Sort (cost=339,304.72..339,349.89 rows=18,066 width=28) (actual time=1.008..1.008 rows=2 loops=1)

  • Sort Key: m_logs_v2.root_serial_type, m_logs_v2.root_serial, ((m_logs_v2.created)::date)
  • Sort Method: quicksort Memory: 25kB
15. 0.026 0.991 ↑ 9,033.0 2 1

Hash Join (cost=0.80..338,027.36 rows=18,066 width=28) (actual time=0.903..0.991 rows=2 loops=1)

  • Hash Cond: (m_logs_v2.process_id = process_ids.id)
16. 0.228 0.228 ↑ 11,506.5 56 1

Index Scan using m_logs_v2_component_id_result_created_idx on m_logs_v2 (cost=0.70..335,385.08 rows=644,364 width=48) (actual time=0.040..0.228 rows=56 loops=1)

  • Index Cond: ((component_id = $5) AND (result = ANY ('{passed,reworked,failed}'::log_state[])) AND (created >= $3) AND (created < $4))
17. 0.005 0.737 ↓ 1.7 5 1

Hash (cost=0.06..0.06 rows=3 width=16) (actual time=0.737..0.737 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.732 0.732 ↓ 1.7 5 1

CTE Scan on process_ids (cost=0.00..0.06 rows=3 width=16) (actual time=0.637..0.732 rows=5 loops=1)

19.          

CTE tmp_logs

20. 0.029 1.126 ↑ 1,850,327.9 63 1

Nested Loop (cost=0.00..41,649,122.10 rows=116,570,658 width=204) (actual time=1.026..1.126 rows=63 loops=1)

21. 1.015 1.015 ↑ 9,033.0 2 1

CTE Scan on tmp_sn (cost=0.00..361.32 rows=18,066 width=32) (actual time=1.010..1.015 rows=2 loops=1)

22. 0.082 0.082 ↑ 201.6 32 2

Index Scan using m_logs_v2_root_serial_idx on m_logs_v2 m_logs_v2_1 (cost=0.00..2,240.85 rows=6,452 width=204) (actual time=0.010..0.041 rows=32 loops=2)

  • Index Cond: (root_serial = tmp_sn.root_serial)
Planning time : 0.960 ms
Execution time : 1.351 ms