explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6NEV

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

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

2.          

CTE closed_checks

3. 11.377 210.898 ↓ 1.3 24,215 1

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

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

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

5. 104.394 104.394 ↓ 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.020..104.394 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.376 ↑ 1.0 8,023 1

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

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

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

9.          

CTE report_data

10. 49.778 283.770 ↑ 1.0 1 1

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

11. 233.992 233.992 ↓ 1.3 24,215 1

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

12. 283.773 283.773 ↑ 1.0 1 1

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