explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jIFg

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.232 ↓ 0.0 0 1

GroupAggregate (cost=32.84..33.32 rows=16 width=266) (actual time=0.232..0.232 rows=0 loops=1)

  • Group Key: sc_workstation.id, (date_trunc('MONTH'::text, defect_item.created_at)), reasons.name
2.          

CTE reasons

3. 0.000 0.000 ↓ 0.0 0

Values Scan on "*VALUES*" (cost=0.00..0.41 rows=33 width=36) (never executed)

4. 0.014 0.230 ↓ 0.0 0 1

Sort (cost=32.43..32.47 rows=16 width=242) (actual time=0.230..0.230 rows=0 loops=1)

  • Sort Key: sc_workstation.id, (date_trunc('MONTH'::text, defect_item.created_at)), reasons.name
  • Sort Method: quicksort Memory: 25kB
5. 0.001 0.216 ↓ 0.0 0 1

Nested Loop (cost=0.00..32.11 rows=16 width=242) (actual time=0.216..0.216 rows=0 loops=1)

  • Join Filter: (SubPlan 2)
6. 0.001 0.215 ↓ 0.0 0 1

Nested Loop (cost=0.00..18.50 rows=1 width=225) (actual time=0.215..0.215 rows=0 loops=1)

  • Join Filter: (defect_item.workzone_id = sc_workstation.id)
7. 0.214 0.214 ↓ 0.0 0 1

Seq Scan on defect_item (cost=0.00..17.45 rows=1 width=47) (actual time=0.214..0.214 rows=0 loops=1)

  • Filter: ((created_at >= '2019-02-01 00:00:00+03'::timestamp with time zone) AND (created_at <= '2019-02-15 00:00:00+03'::timestamp with time zone) AND (sc_user_id <> '-1'::integer))
  • Rows Removed by Filter: 466
8. 0.000 0.000 ↓ 0.0 0

Seq Scan on sc_workstation (cost=0.00..1.02 rows=2 width=186) (never executed)

9. 0.000 0.000 ↓ 0.0 0

CTE Scan on reasons (cost=0.00..0.66 rows=33 width=36) (never executed)

10.          

SubPlan (for Nested Loop)

11. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.51 rows=100 width=2) (never executed)

Planning time : 49.302 ms
Execution time : 0.305 ms