explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6Vs5d

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 3,324.550 ↑ 80.3 3 1

Group (cost=4,493.31..4,494.51 rows=241 width=450) (actual time=3,324.545..3,324.550 rows=3 loops=1)

  • Group Key: "NonProfitOrganization".id
2. 0.016 3,324.542 ↑ 80.3 3 1

Sort (cost=4,493.31..4,493.91 rows=241 width=450) (actual time=3,324.541..3,324.542 rows=3 loops=1)

  • Sort Key: "NonProfitOrganization".id
  • Sort Method: quicksort Memory: 27kB
3. 3,166.704 3,324.526 ↑ 80.3 3 1

Hash Left Join (cost=2,978.37..4,483.77 rows=241 width=450) (actual time=598.719..3,324.526 rows=3 loops=1)

  • Hash Cond: ("locations->city"."stateId" = "locations->city->state".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: 35119
4. 41.799 157.753 ↑ 1.0 35,122 1

Hash Left Join (cost=2,976.05..4,070.96 rows=35,692 width=943) (actual time=51.634..157.753 rows=35,122 loops=1)

  • Hash Cond: (locations."cityId" = "locations->city".id)
5. 32.709 97.471 ↑ 1.0 35,122 1

Hash Left Join (cost=2,064.07..3,065.28 rows=35,692 width=934) (actual time=33.126..97.471 rows=35,122 loops=1)

  • Hash Cond: ("NonProfitOrganization".id = locations."npoId")
6. 31.690 31.690 ↑ 1.0 7,026 1

Seq Scan on "nonProfitOrganizations" "NonProfitOrganization" (cost=0.00..584.01 rows=7,101 width=924) (actual time=0.023..31.690 rows=7,026 loops=1)

  • Filter: (NOT "isSuspended")
7. 15.953 33.072 ↑ 1.0 35,120 1

Hash (cost=1,617.92..1,617.92 rows=35,692 width=14) (actual time=33.071..33.072 rows=35,120 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2090kB
8. 17.119 17.119 ↑ 1.0 35,120 1

Seq Scan on "npoLocations" locations (cost=0.00..1,617.92 rows=35,692 width=14) (actual time=0.010..17.119 rows=35,120 loops=1)

9. 10.705 18.483 ↑ 1.0 29,910 1

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

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

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

11. 0.032 0.069 ↑ 1.0 59 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
12. 0.037 0.037 ↑ 1.0 59 1

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

Planning time : 1.938 ms
Execution time : 3,324.702 ms