explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 99zQ

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

Sort (cost=130,302.61..130,302.62 rows=1 width=226) (actual rows= loops=)

  • Sort Key: cp.ordem, cp.cod
2. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=113,956.24..130,302.60 rows=1 width=226) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=113,955.67..130,296.79 rows=1 width=210) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=113,955.24..130,292.79 rows=1 width=177) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=113,954.81..130,288.64 rows=1 width=172) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=113,954.25..130,284.39 rows=1 width=170) (actual rows= loops=)

  • Hash Cond: ((pc.frn_id = cp.frn_id) AND ((pc.cod)::text = (cp.cod)::text))
  • Filter: ((pc.dt_inic_validade IS NULL) OR (pc.dt_inic_validade = (SubPlan 2)))
7. 0.000 0.000 ↓ 0.0

Index Scan using prccrd_crd_fk_i on cp_preco_cardapio pc (cost=0.57..16,278.83 rows=9,882 width=25) (actual rows= loops=)

  • Index Cond: (frn_id = 183177)
8. 0.000 0.000 ↓ 0.0

Hash (cost=107,737.05..107,737.05 rows=59,206 width=157) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using cp_cardapio_frn_id_cod_ordem_idx on cp_cardapio cp (cost=0.56..107,737.05 rows=59,206 width=157) (actual rows= loops=)

  • Index Cond: (frn_id = 183177)
10.          

SubPlan (forHash Right Join)

11. 0.000 0.000 ↓ 0.0

Result (cost=4.69..4.79 rows=1 width=8) (actual rows= loops=)

12.          

Initplan (forResult)

13. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..4.69 rows=1 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using cp_preco_cardapio_pkey on cp_preco_cardapio pc2 (cost=0.57..4.69 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((cod = (cp.cod)::text) AND (frn_id = cp.frn_id) AND (dt_inic_validade IS NOT NULL) AND (dt_inic_validade <= now()))
15. 0.000 0.000 ↓ 0.0

Index Scan using cp_cardapio_config_pkey on cp_cardapio_config cc (cost=0.56..4.20 rows=1 width=13) (actual rows= loops=)

  • Index Cond: ((frn_id = cp.frn_id) AND (frn_id = 183177) AND ((crd_id)::text = (cp.cod)::text) AND ((chave)::text = 'DESTAQUE'::text))
16. 0.000 0.000 ↓ 0.0

Index Scan using cp_rel_cardapio_pdv_cod on cp_rel_cardapio_pdv relpdv (cost=0.43..4.05 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ((cp.frn_id = frn_id) AND (frn_id = 183177) AND ((cp.cod)::text = (cod_cardapio)::text))
17. 0.000 0.000 ↓ 0.0

Index Scan using cp_tipo_classif_cardapio_pkey on cp_tipo_classif_cardapio ctcc (cost=0.43..4.00 rows=1 width=38) (actual rows= loops=)

  • Index Cond: ((cp.cod_tpoclscrd)::text = (cod)::text)
18. 0.000 0.000 ↓ 0.0

Index Only Scan using cp_complemento_frn_id_compl_cod_compl_idx on cp_complemento co (cost=0.57..3.81 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((frn_id_compl = cp.frn_id) AND (frn_id_compl = 183177) AND (cod_compl = (cp.cod)::text))