explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QKY

Settings
# exclusive inclusive rows x rows loops node
1. 55.341 278,930.307 ↑ 1.0 100,000 1

Limit (cost=3,419,450.26..3,444,785.22 rows=100,000 width=8) (actual time=278,801.093..278,930.307 rows=100,000 loops=1)

2. 0.000 278,874.966 ↑ 1.2 100,000 1

Finalize GroupAggregate (cost=3,419,450.26..3,449,130.93 rows=117,153 width=8) (actual time=278,801.090..278,874.966 rows=100,000 loops=1)

  • Group Key: de.case_id
3. 58.136 278,878.593 ↑ 2.3 100,001 1

Gather Merge (cost=3,419,450.26..3,446,787.87 rows=234,306 width=8) (actual time=278,801.073..278,878.593 rows=100,001 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
4. 2,077.299 278,820.457 ↑ 1.2 100,001 1

Sort (cost=3,418,450.24..3,418,743.12 rows=117,153 width=8) (actual time=278,800.318..278,820.457 rows=100,001 loops=1)

  • Sort Key: de.case_id
  • Sort Method: external merge Disk: 33560kB
5. 5,834.572 276,743.158 ↓ 16.3 1,905,217 1

Partial HashAggregate (cost=3,407,415.58..3,408,587.11 rows=117,153 width=8) (actual time=275,323.471..276,743.158 rows=1,905,217 loops=1)

  • Group Key: de.case_id
6. 84,167.663 270,908.586 ↓ 2.4 2,501,861 1

Parallel Hash Join (cost=334,271.16..3,402,199.80 rows=1,043,156 width=8) (actual time=16,702.243..270,908.586 rows=2,501,861 loops=1)

  • Hash Cond: (de.id = pdt.docket_entry_id)
7. 170,129.961 170,129.961 ↓ 2.4 82,108,507 1

Parallel Seq Scan on docket_entry de (cost=0.00..2,978,436.07 rows=34,092,407 width=12) (actual time=0.095..170,129.961 rows=82,108,507 loops=1)

8. 1,973.130 16,610.962 ↓ 2.4 2,501,861 1

Parallel Hash (cost=321,231.71..321,231.71 rows=1,043,156 width=4) (actual time=16,610.961..16,610.962 rows=2,501,861 loops=1)

  • Buckets: 4194304 Batches: 1 Memory Usage: 130656kB
9. 7,102.994 14,637.832 ↓ 2.4 2,501,861 1

Parallel Bitmap Heap Scan on positve_docket_tags pdt (cost=51,951.26..321,231.71 rows=1,043,156 width=4) (actual time=7,543.737..14,637.832 rows=2,501,861 loops=1)

  • Recheck Cond: (tag_id = 257)
  • Heap Blocks: exact=24506
10. 7,534.838 7,534.838 ↓ 1.0 2,599,321 1

Bitmap Index Scan on ix_positve_docket_tags_tag_id (cost=0.00..51,325.37 rows=2,503,574 width=0) (actual time=7,534.838..7,534.838 rows=2,599,321 loops=1)

  • Index Cond: (tag_id = 257)