explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rZ6r

Settings
# exclusive inclusive rows x rows loops node
1. 1.409 3,643.843 ↑ 325.0 40 1

Nested Loop Left Join (cost=67.49..815,580.09 rows=13,000 width=265) (actual time=95.277..3,643.843 rows=40 loops=1)

2. 0.149 3,641.594 ↑ 325.0 40 1

Nested Loop Left Join (cost=43.86..507,093.27 rows=13,000 width=251) (actual time=95.224..3,641.594 rows=40 loops=1)

3. 0.215 3,639.325 ↑ 325.0 40 1

Nested Loop (cost=4.91..312.05 rows=13,000 width=219) (actual time=95.172..3,639.325 rows=40 loops=1)

4. 1.413 2.750 ↓ 3.1 40 1

Nested Loop (cost=4.66..51.80 rows=13 width=63) (actual time=0.259..2.750 rows=40 loops=1)

5. 0.474 0.697 ↓ 3.1 40 1

Bitmap Heap Scan on shift_log lsl (cost=3.14..17.67 rows=13 width=33) (actual time=0.241..0.697 rows=40 loops=1)

  • Recheck Cond: ((device_id = ANY ('{2748,2739}'::integer[])) AND (tstzrange(start_date, end_date) && '["2019-08-04 21:00:00+00","2019-08-11 21:00:00+00")'::tstzrange))
  • Heap Blocks: exact=148
6. 0.223 0.223 ↓ 47.0 611 1

Bitmap Index Scan on "IDX_L_SL_DEVDATES" (cost=0.00..3.14 rows=13 width=0) (actual time=0.223..0.223 rows=611 loops=1)

  • Index Cond: ((device_id = ANY ('{2748,2739}'::integer[])) AND (tstzrange(start_date, end_date) && '["2019-08-04 21:00:00+00","2019-08-11 21:00:00+00")'::tstzrange))
7. 0.200 0.640 ↑ 1.0 1 40

Bitmap Heap Scan on devices cd (cost=1.51..2.63 rows=1 width=34) (actual time=0.016..0.016 rows=1 loops=40)

  • Recheck Cond: (id = lsl.device_id)
  • Heap Blocks: exact=40
8. 0.440 0.440 ↓ 2.0 2 40

Bitmap Index Scan on "PK_C_DID" (cost=0.00..1.51 rows=1 width=0) (actual time=0.011..0.011 rows=2 loops=40)

  • Index Cond: (id = lsl.device_id)
9. 3,636.360 3,636.360 ↑ 1,000.0 1 40

Function Scan on get_smart_sensor_stats rgsss (cost=0.25..10.25 rows=1,000 width=160) (actual time=90.908..90.909 rows=1 loops=40)

10. 0.560 2.120 ↑ 1.0 1 40

Aggregate (cost=38.95..38.96 rows=1 width=32) (actual time=0.053..0.053 rows=1 loops=40)

11. 0.326 1.560 ↑ 5.5 2 40

Nested Loop (cost=0.70..38.92 rows=11 width=13) (actual time=0.031..0.039 rows=2 loops=40)

12. 0.760 0.760 ↑ 5.5 2 40

Index Scan using "IDX_L_PSMPRDLOGID" on productionlog_shift_managers lpsm (cost=0.42..16.95 rows=11 width=4) (actual time=0.014..0.019 rows=2 loops=40)

  • Index Cond: (productionlog_id = ANY (rgsss.productionlog_id))
13. 0.474 0.474 ↑ 1.0 1 79

Index Scan using "PK_SHIFTM_ID" on shift_managers csm (cost=0.28..2.00 rows=1 width=17) (actual time=0.006..0.006 rows=1 loops=79)

  • Index Cond: (id = lpsm.shift_manager_id)
14. 0.240 0.840 ↑ 1.0 1 40

Aggregate (cost=23.63..23.64 rows=1 width=8) (actual time=0.020..0.021 rows=1 loops=40)

15. 0.600 0.600 ↑ 3.0 4 40

Index Scan using "IDX_L_PRDAMPRDID" on production_amounts lpa (cost=0.29..23.60 rows=12 width=8) (actual time=0.008..0.015 rows=4 loops=40)

  • Index Cond: (productionlog_id = ANY (rgsss.productionlog_id))
Planning time : 1.314 ms
Execution time : 3,644.126 ms