explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XY2F

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 9,212.136 ↓ 0.0 0 1

HashAggregate (cost=8,177.48..8,211.61 rows=3,413 width=448) (actual time=9,212.136..9,212.136 rows=0 loops=1)

  • Group Key: "NonProfitOrganization".id
2. 8,881.228 9,212.115 ↓ 0.0 0 1

Hash Right Join (cost=2,775.39..8,168.95 rows=3,413 width=448) (actual time=9,212.115..9,212.115 rows=0 loops=1)

  • Hash Cond: (locations."npoId" = "NonProfitOrganization".id)
  • Filter: ((npo_make_tsvector("NonProfitOrganization".*) @@ plainto_tsquery('group'::text)) OR ((locations."zipCode")::text = 'test'::text) OR (("locations->city".name)::text = 'test'::text) OR (("locations->city->state".name)::text = 'test'::text) OR (("locations->city->state".code)::text = 'test'::text))
  • Rows Removed by Filter: 101267
3. 73.866 254.453 ↑ 1.0 101,265 1

Hash Left Join (cost=914.30..6,039.17 rows=101,359 width=32) (actual time=17.028..254.453 rows=101,265 loops=1)

  • Hash Cond: ("locations->city"."stateId" = "locations->city->state".id)
4. 122.782 180.531 ↑ 1.0 101,265 1

Hash Left Join (cost=911.98..5,751.67 rows=101,359 width=23) (actual time=16.952..180.531 rows=101,265 loops=1)

  • Hash Cond: (locations."cityId" = "locations->city".id)
5. 40.913 40.913 ↑ 1.0 101,265 1

Seq Scan on "npoLocations" locations (cost=0.00..4,573.59 rows=101,359 width=14) (actual time=0.009..40.913 rows=101,265 loops=1)

6. 9.606 16.836 ↑ 1.0 29,910 1

Hash (cost=538.10..538.10 rows=29,910 width=17) (actual time=16.836..16.836 rows=29,910 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1703kB
7. 7.230 7.230 ↑ 1.0 29,910 1

Seq Scan on cities "locations->city" (cost=0.00..538.10 rows=29,910 width=17) (actual time=0.009..7.230 rows=29,910 loops=1)

8. 0.028 0.056 ↑ 1.0 59 1

Hash (cost=1.59..1.59 rows=59 width=17) (actual time=0.056..0.056 rows=59 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
9. 0.028 0.028 ↑ 1.0 59 1

Seq Scan on states "locations->city->state" (cost=0.00..1.59 rows=59 width=17) (actual time=0.012..0.028 rows=59 loops=1)

10. 30.598 76.434 ↑ 1.0 20,255 1

Hash (cost=1,599.93..1,599.93 rows=20,893 width=920) (actual time=76.433..76.434 rows=20,255 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 18249kB
11. 45.836 45.836 ↑ 1.0 20,255 1

Seq Scan on "nonProfitOrganizations" "NonProfitOrganization" (cost=0.00..1,599.93 rows=20,893 width=920) (actual time=0.018..45.836 rows=20,255 loops=1)

  • Filter: (NOT "isSuspended")