explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L5NW

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

Aggregate (cost=241,168.41..241,168.47 rows=1 width=448) (actual time=282.983..282.983 rows=1 loops=1)

2.          

CTE closed_checks

3. 11.044 209.845 ↓ 1.3 24,215 1

Hash Semi Join (cost=327.51..239,690.44 rows=19,069 width=181) (actual time=2.315..209.845 rows=24,215 loops=1)

  • Hash Cond: (checks.employee_id = employees.id)
4. 20.609 196.557 ↓ 1.3 24,215 1

Nested Loop (cost=0.99..238,815.69 rows=19,069 width=189) (actual time=0.029..196.557 rows=24,215 loops=1)

5. 103.303 103.303 ↓ 1.3 24,215 1

Index Scan using index_checks_on_status_and_bd_and_pid_and_deleted_at on checks (cost=0.56..99,751.95 rows=19,069 width=32) (actual time=0.022..103.303 rows=24,215 loops=1)

  • Index Cond: ((status = ANY ('{0,1}'::integer[])) AND (business_date >= '2019-09-01'::date) AND (business_date <= '2019-12-02'::date) AND (property_id = '74d1ec69-29fb-4853-b241-93f6eca62286'::uuid) AND (deleted_at IS NULL))
6. 72.645 72.645 ↑ 1.0 1 24,215

Index Scan using index_check_summary_reports_on_check_id on check_summary_reports (cost=0.43..7.28 rows=1 width=173) (actual time=0.003..0.003 rows=1 loops=24,215)

  • Index Cond: (check_id = checks.id)
7. 0.998 2.244 ↑ 1.0 8,023 1

Hash (cost=226.23..226.23 rows=8,023 width=16) (actual time=2.244..2.244 rows=8,023 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 441kB
8. 1.246 1.246 ↑ 1.0 8,023 1

Seq Scan on employees (cost=0.00..226.23 rows=8,023 width=16) (actual time=0.005..1.246 rows=8,023 loops=1)

9.          

CTE report_data

10. 49.797 282.937 ↑ 1.0 1 1

Aggregate (cost=1,477.87..1,477.88 rows=1 width=320) (actual time=282.937..282.937 rows=1 loops=1)

11. 233.140 233.140 ↓ 1.3 24,215 1

CTE Scan on closed_checks (cost=0.00..381.38 rows=19,069 width=220) (actual time=2.318..233.140 rows=24,215 loops=1)

12. 282.939 282.939 ↑ 1.0 1 1

CTE Scan on report_data (cost=0.00..0.02 rows=1 width=320) (actual time=282.939..282.939 rows=1 loops=1)