explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gsSL

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.008 2,257.350 ↑ 94.5 2 1

Group (cost=3,512.51..3,513.45 rows=189 width=453) (actual time=2,257.346..2,257.350 rows=2 loops=1)

  • Group Key: "NonProfitOrganization".id
2. 0.012 2,257.342 ↑ 94.5 2 1

Sort (cost=3,512.51..3,512.98 rows=189 width=453) (actual time=2,257.342..2,257.342 rows=2 loops=1)

  • Sort Key: "NonProfitOrganization".id
  • Sort Method: quicksort Memory: 26kB
3. 2,143.916 2,257.330 ↑ 94.5 2 1

Hash Join (cost=2,561.06..3,505.36 rows=189 width=453) (actual time=513.550..2,257.330 rows=2 loops=1)

  • Hash Cond: ("locations->city"."stateId" = "locations->city->state".id)
  • Join 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 Join Filter: 28378
4. 28.451 113.332 ↓ 1.0 28,380 1

Hash Join (cost=2,558.73..3,427.76 rows=28,078 width=949) (actual time=41.985..113.332 rows=28,380 loops=1)

  • Hash Cond: (locations."cityId" = "locations->city".id)
5. 22.175 66.066 ↓ 1.0 28,380 1

Hash Join (cost=1,646.76..2,442.07 rows=28,078 width=940) (actual time=23.130..66.066 rows=28,380 loops=1)

  • Hash Cond: ("NonProfitOrganization".id = locations."npoId")
6. 20.809 20.809 ↑ 1.0 5,677 1

Seq Scan on "nonProfitOrganizations" "NonProfitOrganization" (cost=0.00..464.35 rows=5,735 width=930) (actual time=0.025..20.809 rows=5,677 loops=1)

  • Filter: (NOT "isSuspended")
7. 11.535 23.082 ↓ 1.0 28,380 1

Hash (cost=1,295.78..1,295.78 rows=28,078 width=14) (actual time=23.082..23.082 rows=28,380 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1531kB
8. 11.547 11.547 ↓ 1.0 28,380 1

Seq Scan on "npoLocations" locations (cost=0.00..1,295.78 rows=28,078 width=14) (actual time=0.007..11.547 rows=28,380 loops=1)

9. 10.851 18.815 ↑ 1.0 29,910 1

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

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

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

11. 0.056 0.082 ↑ 1.0 59 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
12. 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.012..0.026 rows=59 loops=1)

Planning time : 2.107 ms
Execution time : 2,257.467 ms