explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JO5x

Settings
# exclusive inclusive rows x rows loops node
1. 0.056 23,306.466 ↓ 40.0 40 1

Sort (cost=401.18..401.19 rows=1 width=96) (actual time=23,306.449..23,306.466 rows=40 loops=1)

  • Sort Key: t.similarity DESC, t.ent_name, t.parent_id
  • Sort Method: quicksort Memory: 32kB
2. 0.067 23,306.410 ↓ 40.0 40 1

Subquery Scan on t (cost=400.82..401.17 rows=1 width=96) (actual time=23,306.203..23,306.410 rows=40 loops=1)

  • Filter: (t.rn = 1)
  • Rows Removed by Filter: 83
3. 0.099 23,306.343 ↓ 12.3 123 1

Unique (cost=400.82..401.05 rows=10 width=96) (actual time=23,306.201..23,306.343 rows=123 loops=1)

4. 0.145 23,306.244 ↓ 12.3 123 1

Sort (cost=400.82..400.85 rows=10 width=96) (actual time=23,306.200..23,306.244 rows=123 loops=1)

  • Sort Key: ents.id, ert.name, er.start_date, er.end_date, er.description, ents.name, (similarity('parallel'::text, (ents.lower_stripped)::text)), (row_number() OVER (?))
  • Sort Method: quicksort Memory: 46kB
5. 0.142 23,306.099 ↓ 12.3 123 1

WindowAgg (cost=400.38..400.66 rows=10 width=96) (actual time=23,305.921..23,306.099 rows=123 loops=1)

6. 0.225 23,305.957 ↓ 12.3 123 1

Sort (cost=400.38..400.41 rows=10 width=84) (actual time=23,305.912..23,305.957 rows=123 loops=1)

  • Sort Key: ents.id, (similarity('parallel'::text, (ents.lower_stripped)::text)) DESC, ents.name
  • Sort Method: quicksort Memory: 41kB
7. 1.079 23,305.732 ↓ 12.3 123 1

Nested Loop Left Join (cost=1.71..400.22 rows=10 width=84) (actual time=686.187..23,305.732 rows=123 loops=1)

8. 0.185 23,281.201 ↓ 22.0 44 1

Nested Loop Left Join (cost=1.27..395.20 rows=2 width=102) (actual time=685.889..23,281.201 rows=44 loops=1)

  • Join Filter: (ert.id = er.ent_relationship_type_id)
  • Rows Removed by Join Filter: 88
9. 0.263 23,280.928 ↓ 22.0 44 1

Nested Loop Left Join (cost=1.27..394.03 rows=2 width=96) (actual time=685.873..23,280.928 rows=44 loops=1)

10. 0.302 23,237.061 ↓ 22.0 44 1

Nested Loop (cost=0.84..393.05 rows=2 width=45) (actual time=684.866..23,237.061 rows=44 loops=1)

11. 23,235.703 23,235.703 ↓ 22.0 44 1

Index Scan using ents__name_trgm_idx on ents ents_drv (cost=0.41..387.76 rows=2 width=8) (actual time=684.843..23,235.703 rows=44 loops=1)

  • Index Cond: ((name)::text ~~* '%parallel%'::text)
  • Filter: (id = COALESCE(id))
12. 1.056 1.056 ↑ 1.0 1 44

Index Scan using ents_pk on ents (cost=0.43..2.65 rows=1 width=41) (actual time=0.024..0.024 rows=1 loops=44)

  • Index Cond: (id = ents_drv.ultimate_parent_id)
13. 43.604 43.604 ↑ 1.0 1 44

Index Scan using ent_relationships_ent_id_related_ent_id_ent_relationship_ty_idx on ent_relationships er (cost=0.43..0.48 rows=1 width=55) (actual time=0.990..0.991 rows=1 loops=44)

  • Index Cond: (ents.id = ent_id)
  • Filter: ((ent_id = related_ent_id) AND (ent_relationship_type_id = ANY ('{1,2,6}'::integer[])))
14. 0.080 0.088 ↑ 1.3 3 44

Materialize (cost=0.00..1.06 rows=4 width=14) (actual time=0.001..0.002 rows=3 loops=44)

15. 0.008 0.008 ↑ 1.3 3 1

Seq Scan on ent_relationship_types ert (cost=0.00..1.04 rows=4 width=14) (actual time=0.007..0.008 rows=3 loops=1)

16. 23.452 23.452 ↑ 5.0 3 44

Index Only Scan using aliases_fkey_ent_id on aliases al (cost=0.43..2.35 rows=15 width=4) (actual time=0.510..0.533 rows=3 loops=44)

  • Index Cond: (ent_id = ents_drv.id)
  • Heap Fetches: 0
Planning time : 5.596 ms
Execution time : 23,306.595 ms