explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YEY4

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

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

2.          

CTE closed_checks

3. 11.155 209.148 ↓ 1.3 24,215 1

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

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

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

5. 104.400 104.400 ↓ 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.021..104.400 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. 1.101 2.342 ↑ 1.0 8,023 1

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

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

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

9.          

CTE report_data

10. 48.877 280.875 ↑ 1.0 1 1

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

11. 231.998 231.998 ↓ 1.3 24,215 1

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

12. 280.878 280.878 ↑ 1.0 1 1

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