explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fwr7

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 2,384.186 ↓ 10.0 10 1

Limit (cost=181,129.06..181,129.06 rows=1 width=96) (actual time=2,384.179..2,384.186 rows=10 loops=1)

2.          

CTE implantacao_subquery

3. 5.564 5.564 ↓ 1.4 14,851 1

Seq Scan on backup_implantacao implantacao (cost=0.00..1,920.97 rows=10,498 width=8) (actual time=0.007..5.564 rows=14,851 loops=1)

  • Filter: (NOT implantado)
  • Rows Removed by Filter: 7,592
4. 0.571 2,384.181 ↓ 10.0 10 1

Sort (cost=179,208.09..179,208.09 rows=1 width=96) (actual time=2,384.178..2,384.181 rows=10 loops=1)

  • Sort Key: backup.id
  • Sort Method: top-N heapsort Memory: 26kB
5. 0.597 2,383.610 ↓ 414.0 414 1

Nested Loop (cost=9,639.21..179,208.08 rows=1 width=96) (actual time=18.390..2,383.610 rows=414 loops=1)

  • Join Filter: (backup.cliente_id = cliente.id)
6. 1,166.279 2,380.115 ↓ 414.0 414 1

Nested Loop Semi Join (cost=9,638.79..179,200.58 rows=1 width=76) (actual time=18.377..2,380.115 rows=414 loops=1)

  • Join Filter: (backup.cliente_id = implantacao_subquery.cliente_id)
  • Rows Removed by Join Filter: 15,646,897
7. 2.020 44.424 ↓ 655.5 1,311 1

Nested Loop (cost=9,638.79..178,634.87 rows=2 width=68) (actual time=5.916..44.424 rows=1,311 loops=1)

8. 0.577 34.456 ↓ 45.2 1,987 1

Nested Loop (cost=9,638.50..178,310.92 rows=44 width=4) (actual time=5.904..34.456 rows=1,987 loops=1)

9. 20.720 23.944 ↓ 45.2 1,987 1

Bitmap Heap Scan on licenca_produto licencaproduto (cost=9,638.08..177,947.34 rows=44 width=4) (actual time=5.892..23.944 rows=1,987 loops=1)

  • Recheck Cond: (id_aplicativo_updc = 2,207,237)
  • Filter: (permissao @> '{"utilizar": true}'::jsonb)
  • Rows Removed by Filter: 3,007
  • Heap Blocks: exact=16,438
10. 3.224 3.224 ↑ 2.7 16,556 1

Bitmap Index Scan on idx_licencaproduto_idaplicativo (cost=0.00..9,638.07 rows=44,468 width=0) (actual time=3.224..3.224 rows=16,556 loops=1)

  • Index Cond: (id_aplicativo_updc = 2,207,237)
11. 9.935 9.935 ↑ 1.0 1 1,987

Index Scan using licenca_pkey on licenca (cost=0.42..8.25 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1,987)

  • Index Cond: (id = licencaproduto.id_licenca)
12. 7.948 7.948 ↑ 1.0 1 1,987

Index Scan using uk_cliente_id on backup (cost=0.29..7.35 rows=1 width=64) (actual time=0.004..0.004 rows=1 loops=1,987)

  • Index Cond: (cliente_id = licenca.id_cliente)
  • Filter: (cloud_size > 0)
  • Rows Removed by Filter: 0
13. 1,169.412 1,169.412 ↓ 1.1 11,935 1,311

CTE Scan on implantacao_subquery (cost=0.00..209.96 rows=10,498 width=8) (actual time=0.000..0.892 rows=11,935 loops=1,311)

14. 2.898 2.898 ↑ 1.0 1 414

Index Scan using pk_cliente_id on cliente (cost=0.42..7.48 rows=1 width=48) (actual time=0.007..0.007 rows=1 loops=414)

  • Index Cond: (id = licenca.id_cliente)
  • Filter: (NOT inadimplente)