explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rlnf

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 22,814.391 ↑ 3.0 1 1

Planning Time: 0.397 msNested Loop Left Join (cost=800,385.55..802,142.34 rows=3 width=191) (actual time=22,706.276..22,814.391 rows=1 loops=1)

2. 0.039 0.039 ↑ 1.0 1 1

Index Scan using accounts_values_pk_id on accounts_values av (cost=0.56..5.77 rows=1 width=17) (actual time=0.039..0.039 rows=1 loops=1)

3. 55.886 22,814.348 ↑ 3.0 1 1

Hash Right Join (cost=16.09..1,756.15 rows=3 width=194) (actual time=22,706.233..22,814.348 rows=1 loops=1)

4. 0.000 22,758.462 ↓ 1.0 76,909 1

Finalize GroupAggregate (cost=1,000.75..800,368.89 rows=76,908 width=12) (actual time=0.899..22,758.462 rows=76,909 loops=1)

  • Index Cond: ((account_id = v.account_id) AND (value_date = v.last_value_date))
  • Hash Cond: (v.account_id = a.id)
5. 0.030 0.030 ↑ 3.0 1 1

Hash (cost=16.06..16.06 rows=3 width=182) (actual time=0.030..0.030 rows=1 loops=1)

6. 69.782 22,789.114 ↓ 1.0 76,909 1

CTE Scan on latest_values_by_account v (cost=0.00..1,538.16 rows=76,908 width=12) (actual time=0.900..22,789.114 rows=76,909 loops=1)

  • Group Key: a_1.id
7. 22,719.304 22,719.332 ↑ 2.0 76,909 1

Gather Merge (cost=1,000.75..798,830.73 rows=153,816 width=12) (actual time=0.836..22,719.332 rows=76,909 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
8. 0.000 0.028 ↑ 3.0 1 1

Bitmap Heap Scan on accounts a (cost=4.32..16.06 rows=3 width=182) (actual time=0.027..0.028 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
9. 22,702.714 22,702.731 ↓ 1.0 76,909 1

Partial GroupAggregate (cost=0.73..780,076.53 rows=76,908 width=12) (actual time=0.461..22,702.731 rows=76,909 loops=1)

  • Recheck Cond: (client_id = '143698403939'::bigint)
  • Heap Blocks: exact=1
10. 0.000 0.017 ↑ 3.0 1 1

Bitmap Index Scan on accounts_client_id_idx (cost=0.00..4.32 rows=3 width=0) (actual time=0.017..0.017 rows=1 loops=1)

  • Group Key: a_1.id
11. 1,576.750 21,518.524 ↓ 2.3 10,961,681 1

Nested Loop Left Join (cost=0.73..755,311.84 rows=4,799,121 width=12) (actual time=0.019..21,518.524 rows=10,961,681 loops=1)

  • Index Cond: (client_id = '143698403939'::bigint)
12. 637.615 637.615 ↓ 2.4 76,909 1

Parallel Index Only Scan using accounts_pk_id on accounts a_1 (cost=0.29..12,942.95 rows=32,045 width=8) (actual time=0.008..637.615 rows=76,909 loops=1)

13. 19,304.159 19,304.159 ↑ 4.1 143 76,909

Index Scan using accounts_values_account_id_index on accounts_values v_1 (cost=0.43..17.29 rows=588 width=12) (actual time=0.013..0.251 rows=143 loops=76,909)

  • Index Cond: (account_id = a_1.id)
  • Heap Fetches: 76909
Execution time : 22,815.395 ms