explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nzs3

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=27,274,407.55..27,274,407.57 rows=10 width=130) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=27,274,407.55..27,274,468.65 rows=24,443 width=130) (actual rows= loops=)

  • Sort Key: (COALESCE(CASE WHEN (charindex('Отдел'::character varying, s.nkod, 0) = 0) THEN 999 ELSE charindex('Отдел'::character varying, s.nkod, 0) END, 999)), (length((s.nkod)::text))
3. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=0.00..27,273,879.34 rows=24,443 width=130) (actual rows= loops=)

  • Join Filter: ((s31_.id <> s.id) AND ((s31_.kod)::text ~~* (rtrim((s.kod)::text) || '%'::text)))
4. 0.000 0.000 ↓ 0.0

Seq Scan on s31 s (cost=0.00..1,869.35 rows=24,566 width=128) (actual rows= loops=)

  • Filter: (((nkod)::text ~~* '%Отдел%'::text) AND (((deact_date IS NULL) AND (deact_comment IS NULL)) OR ((deact_date IS NOT NULL) AND (deact_date > LOCALTIMESTAMP))))
5. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1,745.45 rows=49,563 width=10) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Seq Scan on s31 s31_ (cost=0.00..1,497.63 rows=49,563 width=10) (actual rows= loops=)