explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gk21

Settings
# exclusive inclusive rows x rows loops node
1. 0.042 10,897.512 ↓ 0.0 0 1

HashAggregate (cost=9,477.28..9,518.43 rows=4,115 width=447) (actual time=10,897.511..10,897.512 rows=0 loops=1)

  • Group Key: "NonProfitOrganization".id
2. 10,504.051 10,897.470 ↓ 0.0 0 1

Hash Right Join (cost=2,973.29..9,466.99 rows=4,115 width=447) (actual time=10,897.469..10,897.470 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: 121692
3. 86.509 300.936 ↑ 1.0 121,690 1

Hash Left Join (cost=914.30..7,084.66 rows=122,182 width=32) (actual time=18.683..300.936 rows=121,690 loops=1)

  • Hash Cond: ("locations->city"."stateId" = "locations->city->state".id)
4. 146.025 214.374 ↑ 1.0 121,690 1

Hash Left Join (cost=911.98..6,738.57 rows=122,182 width=23) (actual time=18.612..214.374 rows=121,690 loops=1)

  • Hash Cond: (locations."cityId" = "locations->city".id)
5. 49.966 49.966 ↑ 1.0 121,690 1

Seq Scan on "npoLocations" locations (cost=0.00..5,505.82 rows=122,182 width=14) (actual time=0.012..49.966 rows=121,690 loops=1)

6. 10.730 18.383 ↑ 1.0 29,910 1

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

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

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

8. 0.027 0.053 ↑ 1.0 59 1

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

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

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

10. 36.161 92.483 ↑ 1.0 24,340 1

Hash (cost=1,751.77..1,751.77 rows=24,577 width=918) (actual time=92.483..92.483 rows=24,340 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 21872kB
11. 56.322 56.322 ↑ 1.0 24,340 1

Seq Scan on "nonProfitOrganizations" "NonProfitOrganization" (cost=0.00..1,751.77 rows=24,577 width=918) (actual time=0.018..56.322 rows=24,340 loops=1)

  • Filter: (NOT "isSuspended")
Planning time : 2.385 ms
Execution time : 10,897.737 ms