explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gq7c

Settings
# exclusive inclusive rows x rows loops node
1. 807.940 18,543.909 ↑ 209.0 3,360 1

Unique (cost=3,681,137.27..3,688,160.33 rows=702,306 width=68) (actual time=17,027.841..18,543.909 rows=3,360 loops=1)

2. 2,777.515 17,735.969 ↓ 2.4 1,707,516 1

Sort (cost=3,681,137.27..3,682,893.04 rows=702,306 width=68) (actual time=17,027.838..17,735.969 rows=1,707,516 loops=1)

  • Sort Key: cal.leasing_agent_id, (func_format_customer_name(ce.name_first, ce.name_last, NULL::character varying)), (CASE WHEN ((cu.is_disabled IS NULL) OR (cu.is_disabled = 0)) THEN 'Active'::text ELSE 'Inactive'::text END)
  • Sort Method: quicksort Memory: 182526kB
3. 4,701.696 14,958.454 ↓ 2.4 1,707,516 1

Hash Join (cost=1,573.67..3,612,937.25 rows=702,306 width=68) (actual time=28.599..14,958.454 rows=1,707,516 loops=1)

  • Hash Cond: (cal.leasing_agent_id = ce.id)
4. 1,848.047 10,228.860 ↓ 2.3 1,920,738 1

Nested Loop (cost=0.56..3,423,857.47 rows=840,358 width=8) (actual time=0.450..10,228.860 rows=1,920,738 loops=1)

5. 0.541 0.541 ↑ 1.0 426 1

Seq Scan on load_prop lp (cost=0.00..8.26 rows=426 width=4) (actual time=0.008..0.541 rows=426 loops=1)

6. 8,380.272 8,380.272 ↓ 2.3 4,509 426

Index Scan using idx_cached_application_logs_property_id_reporting_daterange on cached_application_logs cal (cost=0.56..8,017.47 rows=1,973 width=12) (actual time=0.230..19.672 rows=4,509 loops=426)

  • Index Cond: ((property_id = lp.property_id) AND ('2019-01-16'::date >= reporting_post_date) AND ('2019-01-16'::date <= apply_through_post_date))
  • Filter: (cid = 3049)
7. 3.681 27.898 ↑ 1.0 6,660 1

Hash (cost=1,489.86..1,489.86 rows=6,660 width=26) (actual time=27.898..27.898 rows=6,660 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 447kB
8. 8.533 24.217 ↑ 1.0 6,660 1

Hash Right Join (cost=513.03..1,489.86 rows=6,660 width=26) (actual time=8.151..24.217 rows=6,660 loops=1)

  • Hash Cond: ((cu.cid = ce.cid) AND (cu.company_employee_id = ce.id))
9. 7.630 8.295 ↑ 1.0 10,612 1

Bitmap Heap Scan on company_users cu (cost=202.73..1,123.71 rows=10,638 width=12) (actual time=0.745..8.295 rows=10,612 loops=1)

  • Recheck Cond: (cid = 3049)
  • Heap Blocks: exact=635
10. 0.665 0.665 ↑ 1.0 10,613 1

Bitmap Index Scan on pk_company_users (cost=0.00..200.07 rows=10,638 width=0) (actual time=0.665..0.665 rows=10,613 loops=1)

  • Index Cond: (cid = 3049)
11. 3.514 7.389 ↑ 1.0 6,660 1

Hash (cost=210.40..210.40 rows=6,660 width=22) (actual time=7.389..7.389 rows=6,660 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 429kB
12. 3.875 3.875 ↑ 1.0 6,660 1

Seq Scan on company_employees ce (cost=0.00..210.40 rows=6,660 width=22) (actual time=0.008..3.875 rows=6,660 loops=1)

  • Filter: (cid = 3049)
  • Rows Removed by Filter: 92