explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qolC

Settings
# exclusive inclusive rows x rows loops node
1. 33.303 33.303 ↑ 4.7 30 1

CTE Scan on tmp_data (cost=79,696.24..79,699.08 rows=142 width=292) (actual time=25.023..33.303 rows=30 loops=1)

2.          

CTE args

3. 0.008 0.008 ↑ 410.0 1 1

Seq Scan on sites (cost=0.00..14.10 rows=410 width=208) (actual time=0.007..0.008 rows=1 loops=1)

4.          

CTE args_choices

5. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.01..21,635.71 rows=4,100,000 width=64) (never executed)

6. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.01..828.21 rows=41,000 width=64) (never executed)

7. 0.000 0.000 ↓ 0.0 0

CTE Scan on args (cost=0.00..8.20 rows=410 width=32) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Function Scan on jsonb_each configs (cost=0.01..1.01 rows=100 width=64) (never executed)

9.          

CTE option_choices

10. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=26.88..46.23 rows=740 width=80) (never executed)

  • Hash Cond: (choices.option_id = options.id)
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on choices (cost=0.00..17.40 rows=740 width=64) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Hash (cost=17.50..17.50 rows=750 width=48) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Seq Scan on options (cost=0.00..17.50 rows=750 width=48) (never executed)

14.          

CTE tmp_sn

15. 0.000 24.317 ↑ 1.0 10 1

Limit (cost=41,442.48..41,442.55 rows=10 width=24) (actual time=24.304..24.317 rows=10 loops=1)

16.          

Initplan (forLimit)

17. 0.001 0.001 ↑ 410.0 1 1

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

18. 0.001 0.001 ↑ 410.0 1 1

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

19. 0.016 0.016 ↑ 410.0 1 1

CTE Scan on args args_3 (cost=0.00..8.20 rows=410 width=32) (actual time=0.014..0.016 rows=1 loops=1)

20. 0.001 0.001 ↑ 410.0 1 1

CTE Scan on args args_4 (cost=0.00..8.20 rows=410 width=32) (actual time=0.001..0.001 rows=1 loops=1)

21. 0.006 24.310 ↑ 3.3 10 1

Unique (cost=41,409.68..41,409.93 rows=33 width=24) (actual time=24.302..24.310 rows=10 loops=1)

22. 0.740 24.304 ↑ 3.3 10 1

Sort (cost=41,409.68..41,409.76 rows=33 width=24) (actual time=24.302..24.304 rows=10 loops=1)

  • Sort Key: m_logs_v2.root_serial_type, m_logs_v2.root_serial
  • Sort Method: quicksort Memory: 55kB
23. 1.828 23.564 ↓ 11.7 386 1

Nested Loop (cost=0.57..41,408.85 rows=33 width=24) (actual time=19.535..23.564 rows=386 loops=1)

  • Join Filter: (m_logs_v2.process_id = processes.id)
  • Rows Removed by Join Filter: 15886
24. 0.046 0.046 ↓ 3.0 3 1

Seq Scan on processes (cost=0.00..2.92 rows=1 width=16) (actual time=0.033..0.046 rows=3 loops=1)

  • Filter: (name = $6)
  • Rows Removed by Filter: 124
25. 2.202 21.690 ↓ 2.2 5,424 3

Nested Loop (cost=0.57..41,375.44 rows=2,439 width=40) (actual time=0.034..7.230 rows=5,424 loops=3)

26. 0.006 0.033 ↑ 3.0 1 3

Nested Loop (cost=0.00..83.47 rows=3 width=16) (actual time=0.008..0.011 rows=1 loops=3)

  • Join Filter: (components.project_id = projects.id)
  • Rows Removed by Join Filter: 2
27. 0.009 0.009 ↑ 250.0 3 3

Seq Scan on components (cost=0.00..17.50 rows=750 width=32) (actual time=0.002..0.003 rows=3 loops=3)

28. 0.008 0.018 ↑ 4.0 1 9

Materialize (cost=0.00..21.02 rows=4 width=16) (actual time=0.002..0.002 rows=1 loops=9)

29. 0.010 0.010 ↑ 4.0 1 1

Seq Scan on projects (cost=0.00..21.00 rows=4 width=16) (actual time=0.008..0.010 rows=1 loops=1)

  • Filter: (name = $7)
  • Rows Removed by Filter: 2
30. 19.455 19.455 ↑ 49.5 5,424 3

Index Scan using m_logs_v2_component_id_created_idx on m_logs_v2 (cost=0.57..11,080.78 rows=268,321 width=56) (actual time=0.023..6.485 rows=5,424 loops=3)

  • Index Cond: ((component_id = components.id) AND (created >= $4) AND (created < $5))
31.          

CTE tmp_data

32. 7.177 32.284 ↑ 4.7 30 1

Nested Loop (cost=0.57..16,557.65 rows=142 width=302) (actual time=24.926..32.284 rows=30 loops=1)

33. 0.075 24.837 ↑ 4.7 30 1

Nested Loop (cost=0.00..16,401.48 rows=142 width=162) (actual time=24.365..24.837 rows=30 loops=1)

  • Join Filter: (m_logs_v2_1.process_id = processes_1.id)
  • Rows Removed by Join Filter: 2320
34. 0.038 24.523 ↑ 5.5 239 1

Nested Loop (cost=0.00..16,242.10 rows=1,313 width=170) (actual time=24.319..24.523 rows=239 loops=1)

35. 24.325 24.325 ↑ 1.0 10 1

CTE Scan on tmp_sn (cost=0.00..0.20 rows=10 width=64) (actual time=24.305..24.325 rows=10 loops=1)

36. 0.160 0.160 ↑ 13.7 24 10

Index Scan using m_logs_v2_root_serial_idx on m_logs_v2 m_logs_v2_1 (cost=0.00..1,620.91 rows=328 width=130) (actual time=0.004..0.016 rows=24 loops=10)

  • Index Cond: (root_serial = tmp_sn.serial)
  • Filter: (last AND (tmp_sn.serial_type = root_serial_type))
  • Rows Removed by Filter: 1
37. 0.210 0.239 ↓ 1.2 10 239

Materialize (cost=0.00..3.52 rows=8 width=24) (actual time=0.000..0.001 rows=10 loops=239)

38. 0.029 0.029 ↓ 1.2 10 1

Seq Scan on processes processes_1 (cost=0.00..3.48 rows=8 width=24) (actual time=0.009..0.029 rows=10 loops=1)

  • Filter: (name = ANY ('{sp-wld1,sp-wld2,bg-assy,br-bd-wld,br-sp-wld,trim-sp-wld,ump-t3,ump-t1}'::text[]))
  • Rows Removed by Filter: 117
39. 0.270 0.270 ↑ 1.0 1 30

Index Scan using logs_v2_pkey on logs_v2 (cost=0.57..1.08 rows=1 width=821) (actual time=0.009..0.009 rows=1 loops=30)

  • Index Cond: (id = m_logs_v2_1.id)
Planning time : 1.811 ms
Execution time : 33.675 ms