explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RqZa

Settings
# exclusive inclusive rows x rows loops node
1. 0.098 27,676.537 ↑ 1.0 1,000 1

Limit (cost=625,155.65..625,158.15 rows=1,000 width=156) (actual time=27,676.205..27,676.537 rows=1,000 loops=1)

2. 24,639.214 27,676.439 ↑ 184.4 1,000 1

Sort (cost=625,155.65..625,616.76 rows=184,444 width=156) (actual time=27,676.203..27,676.439 rows=1,000 loops=1)

  • Sort Key: org_taxonomy.lms_coverage_area_distances NULLS FIRST, org_taxonomy.updated_at
  • Sort Method: top-N heapsort Memory: 204kB
3. 745.996 3,037.225 ↓ 3.3 613,900 1

Hash Left Join (cost=123,819.54..615,042.78 rows=184,444 width=156) (actual time=689.898..3,037.225 rows=613,900 loops=1)

  • Hash Cond: (organization.id = org_taxonomy.labs_organization_id)
4. 597.872 1,954.148 ↓ 3.3 613,900 1

Hash Join (cost=36,065.08..513,466.92 rows=184,444 width=130) (actual time=352.201..1,954.148 rows=613,900 loops=1)

  • Hash Cond: (topic_vector.topic_context_id = organization.topic_context_id)
5. 1,005.354 1,005.354 ↓ 3.0 1,343,410 1

Seq Scan on topic_vector (cost=0.00..458,296.51 rows=450,105 width=4) (actual time=0.112..1,005.354 rows=1,343,410 loops=1)

  • Filter: ((model_metadata_id = 4) AND (array_length(vector, 1) > 1))
  • Rows Removed by Filter: 6905
6. 185.821 350.922 ↑ 1.0 615,665 1

Hash (cost=16,295.19..16,295.19 rows=617,191 width=130) (actual time=350.922..350.922 rows=615,665 loops=1)

  • Buckets: 32768 Batches: 32 Memory Usage: 2038kB
7. 165.101 165.101 ↑ 1.0 615,665 1

Seq Scan on organization (cost=0.00..16,295.19 rows=617,191 width=130) (actual time=0.088..165.101 rows=615,665 loops=1)

  • Filter: (topic_context_id IS NOT NULL)
  • Rows Removed by Filter: 72754
8. 150.183 337.081 ↑ 1.0 614,619 1

Hash (cost=75,717.65..75,717.65 rows=622,465 width=30) (actual time=337.081..337.081 rows=614,619 loops=1)

  • Buckets: 65536 Batches: 16 Memory Usage: 3062kB
9. 186.898 186.898 ↑ 1.0 614,619 1

Seq Scan on org_taxonomy (cost=0.00..75,717.65 rows=622,465 width=30) (actual time=0.074..186.898 rows=614,619 loops=1)

Planning time : 0.358 ms
Execution time : 27,677.564 ms