explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4K7A

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.002 18,164.758 ↓ 0.0 0 1

Limit (cost=2,712,997.48..2,712,997.54 rows=1 width=537) (actual time=18,164.757..18,164.758 rows=0 loops=1)

2. 0.001 18,164.756 ↓ 0.0 0 1

Unique (cost=2,712,997.48..2,712,997.54 rows=1 width=537) (actual time=18,164.756..18,164.756 rows=0 loops=1)

3. 0.049 18,164.755 ↓ 0.0 0 1

Sort (cost=2,712,997.48..2,712,997.49 rows=1 width=537) (actual time=18,164.755..18,164.755 rows=0 loops=1)

  • Sort Key: "QADIDE"."ID_N_A", "QADIDR"."PRIORITY_N", "QADTHI"."THD_ID_N", "QADIDE"."ID_TYP_C", "QADTHI"."THD_A", "QADTHI"."THD_A_EXTENSION_A", "QADTHI"."THD_A_EXTENSION2_A", (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_COUNTRY_C" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_CTRY_C" ELSE NULL::character varying END), "QADTHI"."LEGAL_FORM_C", "QADTHI"."THD_TYPE_C", "QADTHI"."THD_STA_C", "QADTHI"."THD_NOMENCLATURE_C", "QADTHI"."THD_TRD_SEC_C", (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_TEL_N" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_TEL_N" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_STATE_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_STATE_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_TOWN_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_TOWN_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_STREET_N_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_STREET_N_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_STREET_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_STREET_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_ADD_LINE_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_ADD_LINE_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_PO_C_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_POST_C_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN NULL::character varying WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_CY_POST_C_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_PO_BOX_PO_C_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_PO_BOX_PO_C_A" ELSE NULL::character varying END), (CASE WHEN (("QADTHI"."THD_TYPE_C")::text = 'I'::text) THEN "QADPAD"."PRIV_PO_OFF_BOX_A" WHEN (("QADTHI"."THD_TYPE_C")::text <> 'I'::text) THEN "QADBRA"."BRA_POST_OFF_BOX_A" ELSE NULL::character varying END)
  • Sort Method: quicksort Memory: 25kB
4. 0.000 18,164.706 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,001.57..2,712,997.47 rows=1 width=537) (actual time=18,164.705..18,164.706 rows=0 loops=1)

  • Join Filter: ((("QADIDE"."ID_TYP_C")::text = ("QADIDR"."ID_TYP_C")::text) AND ((("QADBRA"."BRA_CTRY_C")::text = ("QADIDR"."ID_RAN_CTRY_C")::text) OR (("QADPAD"."PRIV_COUNTRY_C")::text = ("QADIDR"."ID_RAN_CTRY_C")::text)))
5. 3.713 18,165.848 ↓ 0.0 0 1

Gather (cost=1,001.57..2,712,943.97 rows=1 width=634) (actual time=18,164.704..18,165.848 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 0.000 18,162.135 ↓ 0.0 0 3

Nested Loop Left Join (cost=1.57..2,711,943.87 rows=1 width=634) (actual time=18,162.135..18,162.135 rows=0 loops=3)

  • Join Filter: (("QADTHI"."THD_TYPE_C")::text = 'I'::text)
  • Filter: ((("QADBRA"."BRA_CTRY_C")::text = 'FR'::text) OR (("QADPAD"."PRIV_COUNTRY_C")::text = 'FR'::text))
  • Rows Removed by Filter: 0
7. 0.000 18,162.128 ↓ 0.0 0 3

Nested Loop Left Join (cost=1.13..2,711,786.98 rows=27 width=400) (actual time=17,383.570..18,162.128 rows=0 loops=3)

  • Join Filter: (("QADTHI"."THD_TYPE_C")::text <> 'I'::text)
8. 0.000 18,162.121 ↓ 0.0 0 3

Nested Loop Left Join (cost=0.57..2,711,270.42 rows=27 width=182) (actual time=17,383.564..18,162.121 rows=0 loops=3)

9. 18,162.109 18,162.109 ↓ 0.0 0 3

Parallel Seq Scan on "QADIDE" (cost=0.00..2,711,038.62 rows=27 width=34) (actual time=17,383.553..18,162.109 rows=0 loops=3)

  • Filter: ((btrim(("ID_N_A")::text) ~~ '%482947108'::text) AND (btrim(("ID_TYP_C")::text) = 'SIREN'::text))
  • Rows Removed by Filter: 42297889
10. 0.025 0.025 ↑ 1.0 1 1

Index Scan using "QADTHIU01" on "QADTHI" (cost=0.57..8.59 rows=1 width=152) (actual time=0.025..0.025 rows=1 loops=1)

  • Index Cond: ("QADIDE"."THD_ID_N" = "THD_ID_N")
11. 0.014 0.014 ↑ 20.0 1 1

Index Scan using "QADBRAS01" on "QADBRA" (cost=0.56..18.88 rows=20 width=222) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: ("QADTHI"."THD_ID_N" = "THD_ID_N")
12. 0.017 0.017 ↓ 0.0 0 1

Index Scan using "QADPADU01" on "QADPAD" (cost=0.43..5.79 rows=1 width=238) (actual time=0.017..0.017 rows=0 loops=1)

  • Index Cond: ("QADTHI"."THD_ID_N" = "THD_ID_N")
13. 0.000 0.000 ↓ 0.0 0

Seq Scan on "QADIDR" (cost=0.00..27.07 rows=1,507 width=16) (never executed)