explain.depesz.com

PostgreSQL's explain analyze made readable

Result: T6rv

Settings
# exclusive inclusive rows x rows loops node
1. 0.036 857.536 ↓ 7.5 15 1

Sort (cost=137,930.87..137,930.87 rows=2 width=433) (actual time=857.535..857.536 rows=15 loops=1)

  • Sort Key: (sum(carpl.earned_number_of_points)) DESC, (row_number() OVER (?))
  • Sort Method: quicksort Memory: 32kB
2. 0.025 857.500 ↓ 7.5 15 1

WindowAgg (cost=137,930.78..137,930.86 rows=2 width=433) (actual time=857.472..857.500 rows=15 loops=1)

3. 0.024 857.475 ↓ 7.5 15 1

WindowAgg (cost=137,930.78..137,930.82 rows=2 width=425) (actual time=857.464..857.475 rows=15 loops=1)

4. 0.022 857.451 ↓ 7.5 15 1

Sort (cost=137,930.78..137,930.79 rows=2 width=417) (actual time=857.450..857.451 rows=15 loops=1)

  • Sort Key: (sum(carpl.earned_number_of_points)) DESC
  • Sort Method: quicksort Memory: 32kB
5. 1.282 857.429 ↓ 7.5 15 1

GroupAggregate (cost=137,930.66..137,930.77 rows=2 width=417) (actual time=855.890..857.429 rows=15 loops=1)

  • Group Key: ca.id
6. 3.651 856.147 ↓ 256.5 3,334 1

Sort (cost=137,930.66..137,930.69 rows=13 width=417) (actual time=855.801..856.147 rows=3,334 loops=1)

  • Sort Key: ca.id
  • Sort Method: quicksort Memory: 1,816kB
7. 86.671 852.496 ↓ 256.5 3,334 1

Nested Loop (cost=0.00..137,930.42 rows=13 width=417) (actual time=670.815..852.496 rows=3,334 loops=1)

  • Join Filter: (ca.id = carpl.call_agent_id)
  • Rows Removed by Join Filter: 1,236,514
8. 695.117 695.117 ↓ 1.6 70,708 1

Seq Scan on call_agent_reward_point_logs carpl (cost=0.00..135,416.44 rows=45,250 width=12) (actual time=663.680..695.117 rows=70,708 loops=1)

  • Filter: ((added_date >= '08/01/2020'::date) AND (earned_number_of_points > '0'::double precision) AND (added_date <= now()))
  • Rows Removed by Filter: 3,024,089
9. 67.258 70.708 ↓ 9.0 18 70,708

Materialize (cost=0.00..1,156.54 rows=2 width=409) (actual time=0.000..0.001 rows=18 loops=70,708)

10. 3.450 3.450 ↓ 9.0 18 1

Seq Scan on call_agents ca (cost=0.00..1,156.53 rows=2 width=409) (actual time=0.522..3.450 rows=18 loops=1)

  • Filter: ((NOT is_disabled) AND (date_terminated IS NULL) AND (department_id = 13) AND (team_id = 1,046))
  • Rows Removed by Filter: 7,084
Planning time : 1.875 ms
Execution time : 857.936 ms