explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kJl5 : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #HrkC4; plan #rBd2; plan #InBG; plan #pXHR; plan #m9vd; plan #NcfB

Settings

Optimization path:

Optimization(s) for this plan:

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

Unique (cost=43.87..44.10 rows=9 width=154) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=43.87..43.90 rows=9 width=154) (actual rows= loops=)

  • Sort Key: h."DiagnosisCode", d."Name", ((s."StatusId")::text), (COALESCE(h."Protocol", ''::text)), (COALESCE(h."AssetStatusId", '0'::bigint)), (COALESCE(h."Id", '0'::bigint)), (COALESCE(h."HealthConditionCauseCommonId", '0'::bigint)), (COALESCE(h."HealthConditionRemedyCommonId", '0'::bigint)), (CASE WHEN (COALESCE(h."Protocol", ''::text) <> ''::text) THEN 1 WHEN (COALESCE(h."DiagnosisCode", ''::text) <> ''::text) THEN 2 ELSE 3 END)
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.91..43.73 rows=9 width=154) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..16.62 rows=1 width=73) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Index Scan using "HealthCondition_IX_AssetStatusId" on "HealthCondition" h (cost=0.29..8.30 rows=1 width=65) (actual rows= loops=)

  • Index Cond: ("AssetStatusId" = 46,109)
6. 0.000 0.000 ↓ 0.0

Index Scan using "AssetHealthCondition_IX_HealthConditionId" on "AssetHealthCondition" a (cost=0.29..8.31 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ("HealthConditionId" = h."Id")
  • Filter: ("AssetId" = 71)
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.33..26.94 rows=8 width=38) (actual rows= loops=)

  • -> Index Scan using "PK_public.Description" on "Description" d (cost=0.27..0.29 rows=1 width=30)" Index Cond: ("Id" = l."DescriptionId")
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=2.06..24.62 rows=8 width=24) (actual rows= loops=)

  • Hash Cond: (l."LanguageId" = l0."Id")
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..23.09 rows=62 width=32) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..12.95 rows=1 width=24) (actual rows= loops=)

  • Join Filter: ((a1."Name")::text = (s."StatusName")::text)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..11.60 rows=1 width=11) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on "Asset" a0 (cost=0.00..3.29 rows=1 width=16) (actual rows= loops=)

  • Filter: (("Id" = 71) AND ("TenantId" = 2))
13. 0.000 0.000 ↓ 0.0

Index Only Scan using "AssetSts_View_IDX" on "AssetStatus" a1 (cost=0.29..8.31 rows=1 width=11) (actual rows= loops=)

  • Index Cond: ("Id" = a0."StatusId")
14. 0.000 0.000 ↓ 0.0

Seq Scan on "Statuses" s (cost=0.00..1.26 rows=7 width=28) (actual rows= loops=)

  • Filter: ("TenantId" = 2)
15. 0.000 0.000 ↓ 0.0

Index Scan using "LanguageDescription_IX_CommonId" on "LanguageDescription" l (cost=0.43..9.52 rows=62 width=24) (actual rows= loops=)

  • Index Cond: ("CommonId" = s."LanguageDescriptionId")
16. 0.000 0.000 ↓ 0.0

Hash (cost=1.30..1.30 rows=3 width=8) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on "Language" l0 (cost=0.00..1.30 rows=3 width=8) (actual rows= loops=)

  • Filter: ("LocalId" = 1,033)