explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XPRy

Settings
# exclusive inclusive rows x rows loops node
1. 0.041 637.092 ↓ 56.0 56 1

Unique (cost=452.93..453.02 rows=1 width=308) (actual time=637.050..637.092 rows=56 loops=1)

2. 0.120 637.051 ↓ 56.0 56 1

Sort (cost=452.93..452.93 rows=1 width=308) (actual time=637.049..637.051 rows=56 loops=1)

  • Sort Key: fse.eln_num_elt_niveau_ray, fse.eln_num_elt_niveau_ssr, (CASE WHEN ((riiw.riiw_planified_source)::text = 'R'::text) THEN trunc(((- date_part('epoch'::text, ((SubPlan 1) / '86400'::double precision))) - date_part('dow'::text, now()))) ELSE (('20'::double precision - date_part('epoch'::text, ((SubPlan 2) / '86400'::double precision))) - date_part('dow'::text, now())) END), t.rln_eln_niveau, co.co_id, co.co_libelle, fse.niv_num_niveau_ray, fse.niv_num_niveau_ssr, t.rln_num_niveau, t.rin_inventory_pere, t.rin_inventory, t.tir_sous_num_tiers_tir, t.rin_type_inventory, t.rin_state_inventory, t.rin_description, t.rle_emplacement, t.rln_num_orga, t.rll_lieu_emplacement, t.rlt_type_emplacement, t.rld_type_detail_emplacement, t.rin_date_creation, t.rin_date_inventaire, t.rin_user_id, riiw.tir_sous_num_tiers_tir, fse.org_num_organisation_org, fse.eln_num_elt_niveau_fam, riiw.riiw_num_orga_toinv, riiw.riiw_num_niveau_toinv, riiw.riiw_eln_niveau_toinv_ca, riiw.rriw_coef_saison, riiw.riiw_num_year, riiw.riiw_num_week, riiw.riiw_date_beg, riiw.riiw_date_end, riiw.riiw_user, riiw.riiw_nb_update_ts, riiw.riiw_planified_source
  • Sort Method: quicksort Memory: 53kB
3. 0.124 636.931 ↓ 56.0 56 1

Nested Loop (cost=1.97..452.92 rows=1 width=308) (actual time=90.001..636.931 rows=56 loops=1)

4. 1.008 636.319 ↓ 80.0 80 1

Nested Loop (cost=1.53..444.39 rows=1 width=187) (actual time=33.297..636.319 rows=80 loops=1)

5. 0.509 58.876 ↓ 2,315.0 2,315 1

Nested Loop (cost=0.98..138.80 rows=1 width=98) (actual time=0.049..58.876 rows=2,315 loops=1)

6. 0.033 0.167 ↓ 120.0 120 1

Nested Loop (cost=0.70..78.09 rows=1 width=61) (actual time=0.019..0.167 rows=120 loops=1)

7. 0.014 0.014 ↑ 1.2 6 1

Index Scan using consolid_id_pkey on consolid_id co (cost=0.28..18.94 rows=7 width=41) (actual time=0.008..0.014 rows=6 loops=1)

  • Index Cond: ((tti_type_num_tiers_tir = 7) AND (tir_num_tiers_tir = 2))
  • Filter: (cni_top_delete <> 1)
8. 0.120 0.120 ↓ 20.0 20 6

Index Scan using consolid_detail_pkey on consolid_detail cod (cost=0.41..8.44 rows=1 width=40) (actual time=0.008..0.020 rows=20 loops=6)

  • Index Cond: ((tti_type_num_tiers_tir = 7) AND (tir_num_tiers_tir = 2) AND (co_id = co.co_id))
  • Filter: (cnd_top_delete <> 1)
9. 58.200 58.200 ↑ 1.0 19 120

Index Scan using flat_structure_eln_pkey on flat_structure_eln fse (cost=0.28..60.53 rows=19 width=53) (actual time=0.088..0.485 rows=19 loops=120)

  • Index Cond: (org_num_organisation_org = (cod.org_num_organisation_eln)::numeric)
  • Filter: ((cod.niv_num_niveau_eln = niv_num_niveau_ray) AND (cod.eln_nul_elt_niveau_eln = eln_num_elt_niveau_ray))
  • Rows Removed by Filter: 2,423
10. 576.435 576.435 ↓ 0.0 0 2,315

Index Scan using rfid_inv_inventories_week_pkey on rfid_inv_inventories_week riiw (cost=0.56..305.58 rows=1 width=101) (actual time=0.245..0.249 rows=0 loops=2,315)

  • Index Cond: ((tti_num_type_tiers_tir = 7) AND (tir_num_tiers_tir = 2) AND (riiw_num_niveau_toinv = fse.niv_num_niveau_fam) AND (riiw_eln_niveau_toinv = fse.eln_num_elt_niveau_fam) AND (riiw_num_year < 9999))
  • Filter: ((fse.org_num_organisation_org = (riiw_num_orga_toinv)::numeric) AND (((riiw_num_year * 100) + riiw_num_week) <= 202,033) AND ((((riiw_planified_source IS NULL) OR ((riiw_planified_source)::text = ANY ('{C,F}'::text[]))) AND (((riiw_num_year * 100) + riiw_num_week) >= 202,030)) OR (((riiw_planified_source)::text = 'R'::text) AND (((riiw_num_year * 100) + riiw_num_week) >= 202,016))))
  • Rows Removed by Filter: 2
11. 0.320 0.320 ↑ 1.0 1 80

Index Scan using rfid_inv_inventory_pkey on rfid_inv_inventory t (cost=0.43..8.39 rows=1 width=117) (actual time=0.004..0.004 rows=1 loops=80)

  • Index Cond: ((rin_inventory = riiw.rin_inventory) AND (tti_num_type_tiers_tir = 7) AND (tir_num_tiers_tir = 2))
  • Filter: (rin_state_inventory = ANY ('{0,99,-2,-1,8,2,3,4}'::integer[]))
  • Rows Removed by Filter: 0
12.          

SubPlan (for Nested Loop)

13. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.06 rows=1 width=16) (never executed)

14. 0.168 0.168 ↑ 1.0 1 56

Result (cost=0.00..0.04 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=56)

Planning time : 2.234 ms
Execution time : 637.205 ms