explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LRiU

Settings
# exclusive inclusive rows x rows loops node
1. 0.043 12,333.587 ↓ 0.0 0 1

HashAggregate (cost=10,606.10..10,652.20 rows=4,610 width=447) (actual time=12,333.587..12,333.587 rows=0 loops=1)

  • Group Key: "NonProfitOrganization".id
2. 11,894.334 12,333.544 ↓ 0.0 0 1

Hash Right Join (cost=3,316.88..10,594.58 rows=4,610 width=447) (actual time=12,333.544..12,333.544 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: 136917
3. 96.656 347.586 ↓ 1.0 136,915 1

Hash Left Join (cost=914.30..7,830.00 rows=136,907 width=32) (actual time=27.315..347.586 rows=136,915 loops=1)

  • Hash Cond: ("locations->city"."stateId" = "locations->city->state".id)
4. 164.821 250.864 ↓ 1.0 136,915 1

Hash Left Join (cost=911.98..7,442.48 rows=136,907 width=23) (actual time=27.236..250.864 rows=136,915 loops=1)

  • Hash Cond: (locations."cityId" = "locations->city".id)
5. 58.845 58.845 ↓ 1.0 136,915 1

Seq Scan on "npoLocations" locations (cost=0.00..6,171.07 rows=136,907 width=14) (actual time=0.014..58.845 rows=136,915 loops=1)

6. 15.513 27.198 ↑ 1.0 29,910 1

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

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

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

8. 0.032 0.066 ↑ 1.0 59 1

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

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

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

10. 35.517 91.624 ↑ 1.0 27,385 1

Hash (cost=2,055.59..2,055.59 rows=27,759 width=918) (actual time=91.624..91.624 rows=27,385 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 24587kB
11. 56.107 56.107 ↑ 1.0 27,385 1

Seq Scan on "nonProfitOrganizations" "NonProfitOrganization" (cost=0.00..2,055.59 rows=27,759 width=918) (actual time=0.017..56.107 rows=27,385 loops=1)

  • Filter: (NOT "isSuspended")