explain.depesz.com

PostgreSQL's explain analyze made readable

Result: INud

Settings
# exclusive inclusive rows x rows loops node
1. 4.520 4.520 ↑ 1.0 1 1

CTE Scan on tmp_his (cost=24,938.81..24,938.83 rows=1 width=232) (actual time=4.519..4.520 rows=1 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 0.192 ↑ 1.0 1 1

Unique (cost=1,578.49..1,578.50 rows=1 width=24) (actual time=0.191..0.192 rows=1 loops=1)

16.          

Initplan (forUnique)

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.013 0.013 ↑ 410.0 1 1

CTE Scan on args args_3 (cost=0.00..8.20 rows=410 width=32) (actual time=0.012..0.013 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.004 0.190 ↑ 1.0 1 1

Sort (cost=1,545.69..1,545.69 rows=1 width=24) (actual time=0.190..0.190 rows=1 loops=1)

  • Sort Key: m_logs_v2.root_serial_type
  • Sort Method: quicksort Memory: 25kB
22. 0.002 0.186 ↑ 1.0 1 1

Nested Loop (cost=0.30..1,545.68 rows=1 width=24) (actual time=0.154..0.186 rows=1 loops=1)

23. 0.003 0.175 ↑ 1.0 1 1

Nested Loop (cost=0.15..1,545.48 rows=1 width=40) (actual time=0.144..0.175 rows=1 loops=1)

24. 0.012 0.164 ↑ 1.0 1 1

Nested Loop (cost=0.00..1,544.05 rows=1 width=40) (actual time=0.133..0.164 rows=1 loops=1)

  • Join Filter: (m_logs_v2.process_id = processes.id)
  • Rows Removed by Join Filter: 47
25. 0.056 0.056 ↓ 2.0 2 1

Seq Scan on processes (cost=0.00..2.92 rows=1 width=16) (actual time=0.034..0.056 rows=2 loops=1)

  • Filter: (name = $6)
  • Rows Removed by Filter: 96
26. 0.096 0.096 ↓ 3.4 24 2

Index Scan using m_logs_v2_root_serial_idx on m_logs_v2 (cost=0.00..1,541.04 rows=7 width=56) (actual time=0.010..0.048 rows=24 loops=2)

  • Index Cond: (root_serial = 'FP293471Z21MRPQR804'::text)
  • Filter: ((first_time >= $4) AND (first_time < $5))
27. 0.008 0.008 ↑ 1.0 1 1

Index Scan using components_pkey on components (cost=0.15..1.42 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (id = m_logs_v2.component_id)
28. 0.009 0.009 ↑ 1.0 1 1

Index Scan using projects_pkey on projects (cost=0.15..0.19 rows=1 width=16) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: (id = components.project_id)
  • Filter: (name = $7)
29.          

CTE tmp_his

30. 0.008 4.517 ↑ 1.0 1 1

GroupAggregate (cost=1,663.57..1,664.27 rows=1 width=232) (actual time=4.517..4.517 rows=1 loops=1)

  • Group Key: tmp_sn.serial_type, tmp_sn.serial
31.          

Initplan (forGroupAggregate)

32. 0.001 0.001 ↑ 410.0 1 1

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

33. 0.001 0.001 ↑ 410.0 1 1

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

34. 0.001 0.001 ↑ 410.0 1 1

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

35. 0.001 0.001 ↑ 410.0 1 1

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

36. 0.001 0.001 ↑ 410.0 1 1

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

37. 0.002 0.002 ↑ 410.0 1 1

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

38. 0.001 0.001 ↑ 410.0 1 1

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

39. 0.012 4.501 ↑ 3.4 5 1

Sort (cost=1,606.17..1,606.22 rows=17 width=290) (actual time=4.500..4.501 rows=5 loops=1)

  • Sort Key: tmp_sn.serial_type, tmp_sn.serial
  • Sort Method: quicksort Memory: 25kB
40. 0.026 4.489 ↑ 3.4 5 1

Nested Loop Left Join (cost=3.64..1,605.83 rows=17 width=290) (actual time=2.595..4.489 rows=5 loops=1)

  • Join Filter: (processes_1.name = $17)
  • Rows Removed by Join Filter: 2
41. 0.025 2.625 ↑ 8.5 2 1

Nested Loop Left Join (cost=3.64..1,584.36 rows=17 width=1,039) (actual time=1.420..2.625 rows=2 loops=1)

  • Join Filter: (processes_1.name = $15)
42. 0.006 0.382 ↑ 8.5 2 1

Nested Loop (cost=3.63..1,562.89 rows=17 width=943) (actual time=0.323..0.382 rows=2 loops=1)

43. 0.017 0.342 ↑ 8.5 2 1

Hash Join (cost=3.07..1,545.80 rows=17 width=154) (actual time=0.303..0.342 rows=2 loops=1)

  • Hash Cond: (m_logs_v2_1.process_id = processes_1.id)
44. 0.009 0.239 ↑ 13.0 24 1

Nested Loop (cost=0.00..1,541.87 rows=311 width=162) (actual time=0.199..0.239 rows=24 loops=1)

45. 0.193 0.193 ↑ 1.0 1 1

CTE Scan on tmp_sn (cost=0.00..0.02 rows=1 width=64) (actual time=0.192..0.193 rows=1 loops=1)

46. 0.037 0.037 ↑ 13.0 24 1

Index Scan using m_logs_v2_root_serial_idx on m_logs_v2 m_logs_v2_1 (cost=0.00..1,538.74 rows=311 width=122) (actual time=0.005..0.037 rows=24 loops=1)

  • Index Cond: (root_serial = tmp_sn.serial)
  • Filter: (last AND (tmp_sn.serial_type = root_serial_type))
47. 0.005 0.086 ↑ 1.0 4 1

Hash (cost=3.02..3.02 rows=4 width=24) (actual time=0.086..0.086 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
48. 0.081 0.081 ↑ 1.0 4 1

Seq Scan on processes processes_1 (cost=0.00..3.02 rows=4 width=24) (actual time=0.021..0.081 rows=4 loops=1)

  • Filter: (name = ANY (ARRAY[$11, $12, $13]))
  • Rows Removed by Filter: 94
49. 0.034 0.034 ↑ 1.0 1 2

Index Scan using logs_v2_pkey on logs_v2 (cost=0.57..1.01 rows=1 width=821) (actual time=0.017..0.017 rows=1 loops=2)

  • Index Cond: (id = m_logs_v2_1.id)
50. 2.218 2.218 ↓ 0.0 0 2

Function Scan on jsonb_to_recordset station (cost=0.01..1.25 rows=1 width=96) (actual time=1.058..1.109 rows=0 loops=2)

  • Filter: (sub_test = $14)
  • Rows Removed by Filter: 626
51. 1.838 1.838 ↓ 3.0 3 2

Function Scan on jsonb_to_recordset cnc_data (cost=0.01..1.25 rows=1 width=64) (actual time=0.903..0.919 rows=3 loops=2)

  • Filter: (test = $16)
  • Rows Removed by Filter: 624
Planning time : 2.917 ms
Execution time : 4.824 ms