explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8Aia : Optimization for: plan #CLbl

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 8,657.636 17,295.609 ↑ 1.5 2 1

Merge Join (cost=7,868.04..107,512.95 rows=3 width=64) (actual time=15,639.552..17,295.609 rows=2 loops=1)

  • Merge Cond: (r.term_id = lti.incompatible_term_id)
  • Join Filter: (((NOT l.deactivated) OR (NOT r.deactivated)) AND (((l.license_id = 'c3277b46-05a5-4d67-aeea-ca499d9e89b7'::uuid) AND (l.term_id = 'db962b1a-cc21-442b-bb6d-4fd9ecabcbfd'::uuid)) OR ((r.license_id = 'c3277b46-05a5-4d67-aeea-ca499d9e89b7'::uuid) AND (r.term_id = 'db962b1a-cc21-442b-bb6d-4fd9ecabcbfd'::uuid))))
  • Rows Removed by Join Filter: 1,417,086
2. 192.515 295.429 ↑ 1.0 15,076 1

Sort (cost=1,430.90..1,468.61 rows=15,086 width=33) (actual time=210.345..295.429 rows=15,076 loops=1)

  • Sort Key: r.term_id
  • Sort Method: quicksort Memory: 1,563kB
3. 102.914 102.914 ↓ 1.0 15,088 1

Seq Scan on central_license_license_term r (cost=0.00..383.86 rows=15,086 width=33) (actual time=0.021..102.914 rows=15,088 loops=1)

4. 8,106.145 8,342.544 ↓ 26.9 1,421,779 1

Sort (cost=6,437.14..6,569.15 rows=52,801 width=49) (actual time=299.110..8,342.544 rows=1,421,779 loops=1)

  • Sort Key: lti.incompatible_term_id
  • Sort Method: quicksort Memory: 1,784kB
5. 148.726 236.399 ↑ 5.3 9,953 1

Hash Join (cost=25.75..2,295.36 rows=52,801 width=49) (actual time=0.611..236.399 rows=9,953 loops=1)

  • Hash Cond: (l.term_id = lti.term_id)
6. 87.117 87.117 ↓ 1.0 15,088 1

Seq Scan on central_license_license_term l (cost=0.00..383.86 rows=15,086 width=33) (actual time=0.013..87.117 rows=15,088 loops=1)

7. 0.285 0.556 ↑ 15.2 46 1

Hash (cost=17.00..17.00 rows=700 width=32) (actual time=0.551..0.556 rows=46 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
8. 0.271 0.271 ↑ 15.2 46 1

Seq Scan on central_license_term_incompatibility lti (cost=0.00..17.00 rows=700 width=32) (actual time=0.010..0.271 rows=46 loops=1)