explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mrks

Settings
# exclusive inclusive rows x rows loops node
1. 7.513 314.440 ↓ 10.0 70 1

GroupAggregate (cost=3,027.25..3,027.39 rows=7 width=36) (actual time=300.707..314.440 rows=70 loops=1)

  • Group Key: m0301.codigo_a
2. 27.702 306.927 ↓ 4,930.1 34,511 1

Sort (cost=3,027.25..3,027.27 rows=7 width=10) (actual time=300.687..306.927 rows=34,511 loops=1)

  • Sort Key: m0301.codigo_a
  • Sort Method: external merge Disk: 680kB
3. 30.968 279.225 ↓ 4,930.1 34,511 1

Nested Loop (cost=1.41..3,027.15 rows=7 width=10) (actual time=0.086..279.225 rows=34,511 loops=1)

4. 22.347 75.627 ↓ 4,932.3 34,526 1

Nested Loop (cost=0.99..3,018.58 rows=7 width=21) (actual time=0.069..75.627 rows=34,526 loops=1)

5. 4.269 4.269 ↓ 6.6 2,883 1

Index Scan using v0201_pkey on v0201 (cost=0.43..1,791.58 rows=439 width=14) (actual time=0.044..4.269 rows=2,883 loops=1)

  • Index Cond: ((empresa = 1) AND (ejercicio = 2,020) AND ((almacen)::text = '35'::text))
  • Filter: ((fecha_documento >= '2020-01-01'::date) AND (fecha_documento <= '2020-12-31'::date))
6. 49.011 49.011 ↓ 12.0 12 2,883

Index Scan using v020101_1 on v020101 (cost=0.56..2.78 rows=1 width=33) (actual time=0.009..0.017 rows=12 loops=2,883)

  • Index Cond: ((albaran = v0201.documento) AND ((almacen)::text = '35'::text) AND (ejercicio = 2,020) AND ((tipo_movimiento)::text = (v0201.tipo_doc)::text) AND (empresa = 1))
7. 172.630 172.630 ↑ 1.0 1 34,526

Index Scan using m0301_pkey on m0301 (cost=0.42..1.22 rows=1 width=19) (actual time=0.005..0.005 rows=1 loops=34,526)

  • Index Cond: (((codigo)::text = (v020101.articulo)::text) AND (empresa = 1))
Planning time : 2.152 ms