explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SUy5 : LoanByDate

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=54,834,342.17..60,441,195.82 rows=40,000 width=328) (actual rows= loops=)

  • Group Key: (COALESCE((date_trunc('day'::text, t.date)), pay.date))
2. 0.000 0.000 ↓ 0.0

Sort (cost=54,834,342.17..55,301,463.31 rows=186,848,455 width=184) (actual rows= loops=)

  • Sort Key: (COALESCE((date_trunc('day'::text, t.date)), pay.date)) DESC
3. 0.000 0.000 ↓ 0.0

Hash Full Join (cost=651,251.66..698,693.08 rows=186,848,455 width=184) (actual rows= loops=)

  • Hash Cond: ((date_trunc('day'::text, t.date)) = pay.date)
4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=640,688.10..665,400.78 rows=823,756 width=32) (actual rows= loops=)

  • Group Key: (date_trunc('day'::text, t.date))
5. 0.000 0.000 ↓ 0.0

Sort (cost=640,688.10..642,747.49 rows=823,756 width=10) (actual rows= loops=)

  • Sort Key: (date_trunc('day'::text, t.date))
6. 0.000 0.000 ↓ 0.0

Index Scan using tracks_date_index on tracks t (cost=0.44..551,700.42 rows=823,756 width=10) (actual rows= loops=)

  • Index Cond: ((date >= '2020-02-05 21:00:00+03'::timestamp with time zone) AND (date <= '2020-02-20 20:59:59+03'::timestamp with time zone))
7. 0.000 0.000 ↓ 0.0

Hash (cost=8,977.49..8,977.49 rows=45,365 width=160) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Subquery Scan on pay (cost=5,688.53..8,977.49 rows=45,365 width=160) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=5,688.53..8,523.84 rows=45,365 width=160) (actual rows= loops=)

  • Group Key: (date_trunc('day'::text, p.date))
10. 0.000 0.000 ↓ 0.0

Sort (cost=5,688.53..5,801.94 rows=45,365 width=110) (actual rows= loops=)

  • Sort Key: (date_trunc('day'::text, p.date))
11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=142.02..2,179.71 rows=45,365 width=110) (actual rows= loops=)

  • Hash Cond: (p.action_id = a.id)
12. 0.000 0.000 ↓ 0.0

Index Scan using postbacks_date_index on postbacks p (cost=0.43..1,805.49 rows=45,365 width=124) (actual rows= loops=)

  • Index Cond: ((date >= '2020-02-05 21:00:00+03'::timestamp with time zone) AND (date <= '2020-02-20 20:59:59+03'::timestamp with time zone))
  • Filter: (updated_by IS NULL)
13. 0.000 0.000 ↓ 0.0

Hash (cost=94.04..94.04 rows=3804 width=10)" -> Seq Scan on actions a (cost=0.00..94.04 rows=3,804 width=10) (actual rows= loops=)