explain.depesz.com

PostgreSQL's explain analyze made readable

Result: derX

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 266.186 ↑ 1.0 3 1

Sort (cost=181,530.55..181,530.56 rows=3 width=16) (actual time=266.186..266.186 rows=3 loops=1)

  • Sort Key: (CASE WHEN (p.timeslot = 0) THEN 1000000 ELSE p.timeslot END) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.002 266.181 ↑ 1.0 3 1

Subquery Scan on p (cost=181,530.46..181,530.52 rows=3 width=16) (actual time=266.180..266.181 rows=3 loops=1)

3. 0.006 266.179 ↑ 1.0 3 1

HashAggregate (cost=181,530.46..181,530.49 rows=3 width=12) (actual time=266.178..266.179 rows=3 loops=1)

  • Group Key: points.timeslot, (count(points.id))
4. 0.002 266.173 ↑ 1.0 3 1

Append (cost=166,765.34..181,530.44 rows=3 width=12) (actual time=206.381..266.173 rows=3 loops=1)

5. 0.001 206.383 ↑ 1.0 2 1

Unique (cost=166,765.34..166,765.42 rows=2 width=12) (actual time=206.381..206.383 rows=2 loops=1)

6. 0.005 206.382 ↑ 1.0 2 1

Finalize GroupAggregate (cost=166,765.34..166,765.42 rows=2 width=12) (actual time=206.380..206.382 rows=2 loops=1)

  • Group Key: points.timeslot
7. 0.007 206.377 ↓ 1.2 10 1

Sort (cost=166,765.34..166,765.36 rows=8 width=12) (actual time=206.376..206.377 rows=10 loops=1)

  • Sort Key: points.timeslot
  • Sort Method: quicksort Memory: 25kB
8. 49.196 206.370 ↓ 1.2 10 1

Gather (cost=166,764.40..166,765.22 rows=8 width=12) (actual time=206.364..206.370 rows=10 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
9. 25.572 157.174 ↑ 1.0 2 5

Partial HashAggregate (cost=165,764.40..165,764.42 rows=2 width=12) (actual time=157.174..157.174 rows=2 loops=5)

  • Group Key: points.timeslot
10. 122.041 131.602 ↑ 1.2 33,775 5

Parallel Bitmap Heap Scan on points (cost=3,091.34..165,554.56 rows=41,968 width=41) (actual time=2.341..131.602 rows=33,775 loops=5)

  • Recheck Cond: (timeslot IS NOT NULL)
  • Filter: ((is_timeslot_latest IS TRUE) AND (is_preview IS FALSE) AND (is_duplicate IS FALSE))
  • Rows Removed by Filter: 624
  • Heap Blocks: exact=6116
11. 9.561 9.561 ↓ 1.0 171,995 1

Bitmap Index Scan on points_default_timeslot_filter_idx (cost=0.00..3,049.37 rows=170,457 width=0) (actual time=9.561..9.561 rows=171,995 loops=1)

  • Index Cond: ((timeslot IS NOT NULL) AND (is_timeslot_latest = true))
12. 0.005 59.788 ↑ 1.0 1 1

Finalize Aggregate (cost=14,764.98..14,764.99 rows=1 width=12) (actual time=59.788..59.788 rows=1 loops=1)

13. 22.042 59.783 ↓ 1.2 5 1

Gather (cost=14,764.56..14,764.97 rows=4 width=8) (actual time=58.688..59.783 rows=5 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
14. 5.434 37.741 ↑ 1.0 1 5

Partial Aggregate (cost=13,764.56..13,764.57 rows=1 width=8) (actual time=37.741..37.741 rows=1 loops=5)

15. 32.307 32.307 ↑ 1.2 33,472 5

Parallel Index Only Scan using points_default_filter_idx on points points_1 (cost=0.42..13,660.46 rows=41,639 width=0) (actual time=2.248..32.307 rows=33,472 loops=5)

  • Index Cond: ((is_all_timeslots_latest = true) AND (is_duplicate = false) AND (is_preview = false))
  • Filter: ((is_all_timeslots_latest IS TRUE) AND (is_preview IS FALSE) AND (is_duplicate IS FALSE))
  • Heap Fetches: 0
Planning time : 0.263 ms
Execution time : 266.581 ms