explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B3Y0

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 3,417.616 ↓ 0.0 0 1

Sort (cost=122,632.59..122,632.59 rows=1 width=96) (actual time=3,417.616..3,417.616 rows=0 loops=1)

  • Sort Key: t.similarity DESC, t.ent_name, t.parent_id
  • Sort Method: quicksort Memory: 25kB
2. 0.001 3,417.606 ↓ 0.0 0 1

Subquery Scan on t (cost=122,632.23..122,632.58 rows=1 width=96) (actual time=3,417.605..3,417.606 rows=0 loops=1)

  • Filter: (t.rn = 1)
3. 0.002 3,417.605 ↓ 0.0 0 1

Unique (cost=122,632.23..122,632.45 rows=10 width=96) (actual time=3,417.604..3,417.605 rows=0 loops=1)

4. 0.007 3,417.603 ↓ 0.0 0 1

Sort (cost=122,632.23..122,632.25 rows=10 width=96) (actual time=3,417.603..3,417.603 rows=0 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: 25kB
5. 0.004 3,417.596 ↓ 0.0 0 1

WindowAgg (cost=122,631.79..122,632.06 rows=10 width=96) (actual time=3,417.595..3,417.596 rows=0 loops=1)

6. 0.005 3,417.592 ↓ 0.0 0 1

Sort (cost=122,631.79..122,631.81 rows=10 width=84) (actual time=3,417.592..3,417.592 rows=0 loops=1)

  • Sort Key: ents.id, (similarity('parallel'::text, (ents.lower_stripped)::text)) DESC, ents.name
  • Sort Method: quicksort Memory: 25kB
7. 0.001 3,417.587 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.29..122,631.62 rows=10 width=84) (actual time=3,417.587..3,417.587 rows=0 loops=1)

8. 0.001 3,417.586 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.86..122,626.60 rows=2 width=102) (actual time=3,417.586..3,417.586 rows=0 loops=1)

  • Join Filter: (ert.id = er.ent_relationship_type_id)
9. 0.001 3,417.585 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.86..122,625.43 rows=2 width=96) (actual time=3,417.585..3,417.585 rows=0 loops=1)

10. 0.002 3,417.584 ↓ 0.0 0 1

Nested Loop (cost=0.43..122,624.46 rows=2 width=45) (actual time=3,417.584..3,417.584 rows=0 loops=1)

11. 3,417.582 3,417.582 ↓ 0.0 0 1

Seq Scan on ents ents_drv (cost=0.00..122,619.16 rows=2 width=8) (actual time=3,417.582..3,417.582 rows=0 loops=1)

  • Filter: (((name)::text ~* '%parallel%'::text) AND (id = COALESCE(id)))
  • Rows Removed by Filter: 3362187
12. 0.000 0.000 ↓ 0.0 0

Index Scan using ents_pk on ents (cost=0.43..2.65 rows=1 width=41) (never executed)

  • Index Cond: (id = ents_drv.ultimate_parent_id)
13. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • Index Cond: (ents.id = ent_id)
  • Filter: ((ent_id = related_ent_id) AND (ent_relationship_type_id = ANY ('{1,2,6}'::integer[])))
14. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.06 rows=4 width=14) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on ent_relationship_types ert (cost=0.00..1.04 rows=4 width=14) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using aliases_fkey_ent_id on aliases al (cost=0.43..2.35 rows=15 width=4) (never executed)

  • Index Cond: (ent_id = ents_drv.id)
  • Heap Fetches: 0
Planning time : 9.028 ms
Execution time : 3,426.184 ms