explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H0U8 : Optimization for: plan #WL7R

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 2,464.495 ↑ 1.0 2 1

Limit (cost=170,912.29..170,912.29 rows=2 width=36) (actual time=2,464.494..2,464.495 rows=2 loops=1)

2. 0.009 2,464.493 ↑ 1.0 2 1

Sort (cost=170,912.29..170,912.29 rows=2 width=36) (actual time=2,464.493..2,464.493 rows=2 loops=1)

  • Sort Key: (avg(resultsets_huge.trust)) DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.014 2,464.484 ↑ 1.0 2 1

Finalize GroupAggregate (cost=170,912.22..170,912.28 rows=2 width=36) (actual time=2,464.482..2,464.484 rows=2 loops=1)

  • Group Key: resultset_personas_n.persona_id
4. 0.000 2,464.470 ↓ 1.5 6 1

Sort (cost=170,912.22..170,912.23 rows=4 width=36) (actual time=2,464.469..2,464.470 rows=6 loops=1)

  • Sort Key: resultset_personas_n.persona_id
  • Sort Method: quicksort Memory: 25kB
5. 17.568 2,465.836 ↓ 1.5 6 1

Gather (cost=170,893.21..170,912.18 rows=4 width=36) (actual time=2,463.311..2,465.836 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 0.437 2,448.268 ↑ 1.0 2 3

Partial GroupAggregate (cost=169,893.21..169,911.78 rows=2 width=36) (actual time=2,448.019..2,448.268 rows=2 loops=3)

  • Group Key: resultset_personas_n.persona_id
7. 0.814 2,447.831 ↑ 1.1 2,201 3

Sort (cost=169,893.21..169,899.39 rows=2,474 width=8) (actual time=2,447.658..2,447.831 rows=2,201 loops=3)

  • Sort Key: resultset_personas_n.persona_id
  • Sort Method: quicksort Memory: 126kB
8. 1,395.714 2,447.017 ↑ 1.1 2,201 3

Hash Join (cost=28,056.10..169,753.77 rows=2,474 width=8) (actual time=221.868..2,447.017 rows=2,201 loops=3)

  • Hash Cond: (resultset_personas_n.result_set_id = resultsets_huge.id)
9. 1,023.970 1,023.970 ↑ 1.3 4,876,721 3

Parallel Seq Scan on resultset_personas_n (cost=0.00..125,695.73 rows=6,095,973 width=8) (actual time=0.120..1,023.970 rows=4,876,721 loops=3)

10. 3.445 27.333 ↓ 1.1 7,800 3

Hash (cost=27,966.97..27,966.97 rows=7,131 width=8) (actual time=27.333..27.333 rows=7,800 loops=3)

  • Buckets: 8192 Batches: 1 Memory Usage: 369kB
11. 18.113 23.888 ↓ 1.1 7,800 3

Bitmap Heap Scan on resultsets_huge (cost=571.48..27,966.97 rows=7,131 width=8) (actual time=6.789..23.888 rows=7,800 loops=3)

  • Recheck Cond: ((companyid = '2b2926ff-2ef2-4d2f-a21f-f8bc73369a98'::uuid) AND (conducted >= '2019-02-28 00:00:00+00'::timestamp with time zone) AND (conducted <= '2019-03-28 00:00:00+00'::timestamp with time zone))
  • Heap Blocks: exact=6195
12. 5.775 5.775 ↓ 1.1 7,800 3

Bitmap Index Scan on company_conducred_media_idx (cost=0.00..569.70 rows=7,131 width=0) (actual time=5.775..5.775 rows=7,800 loops=3)

  • Index Cond: ((companyid = '2b2926ff-2ef2-4d2f-a21f-f8bc73369a98'::uuid) AND (conducted >= '2019-02-28 00:00:00+00'::timestamp with time zone) AND (conducted <= '2019-03-28 00:00:00+00'::timestamp with time zone))