explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M7Wa : Optimization for: idx04_sal_f_sales_det_cab_201712; plan #eok4

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5,181.536 9,038.415 ↓ 8,007,249.0 8,007,249 1

Gather (cost=1,000.00..306,403.95 rows=1 width=128) (actual time=2.335..9,038.415 rows=8,007,249 loops=1)

  • Output: sal_f_sales_det_cab.id_store, sal_f_sales_det_cab.id_tpv, sal_f_sales_det_cab.id_ticket, sal_f_sales_det_cab.id_cash, sal_f_sales_det_cab.dt_sale, sal_f_sales_det_cab.ti_hour, sal_f_sales_det_cab.id_ticket_type, sal_f_sales_det_cab.vl_sale, sal_f_sales_det_cab.co_service, sal_f_sales_det_cab.co_card, sal_f_sales_det_lin.id_store, sal_f_sales_det_lin.id_tpv, sal_f_sales_det_lin.id_ticket, sal_f_sales_det_lin.id_cash, sal_f_sales_det_lin.dt_sale, sal_f_sales_det_lin.ti_hour, sal_f_sales_det_lin.id_ticket_type, sal_f_sales_det_lin.id_line_type, sal_f_sales_det_lin.co_department, sal_f_sales_det_lin.vl_sale_ori, sal_f_sales_det_lin.vl_sale, sal_f_sales_det_lin.qt_units, sal_f_sales_det_lin.co_section, sal_f_sales_det_lin.id_tax, sal_f_sales_det_lin.co_product, sal_f_sales_det_lin.id_offer, sal_f_sales_det_lin.vl_amount, sal_f_sales_det_lin.id_format, sal_f_sales_det_lin.co_auxiliar
  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=4338980
2. 1,016.194 3,856.879 ↓ 2,001,812.0 2,001,812 4 / 4

Nested Loop (cost=0.00..305,403.85 rows=1 width=128) (actual time=0.091..3,856.879 rows=2,001,812 loops=4)

  • Output: sal_f_sales_det_cab.id_store, sal_f_sales_det_cab.id_tpv, sal_f_sales_det_cab.id_ticket, sal_f_sales_det_cab.id_cash, sal_f_sales_det_cab.dt_sale, sal_f_sales_det_cab.ti_hour, sal_f_sales_det_cab.id_ticket_type, sal_f_sales_det_cab.vl_sale, sal_f_sales_det_cab.co_service, sal_f_sales_det_cab.co_card, sal_f_sales_det_lin.id_store, sal_f_sales_det_lin.id_tpv, sal_f_sales_det_lin.id_ticket, sal_f_sales_det_lin.id_cash, sal_f_sales_det_lin.dt_sale, sal_f_sales_det_lin.ti_hour, sal_f_sales_det_lin.id_ticket_type, sal_f_sales_det_lin.id_line_type, sal_f_sales_det_lin.co_department, sal_f_sales_det_lin.vl_sale_ori, sal_f_sales_det_lin.vl_sale, sal_f_sales_det_lin.qt_units, sal_f_sales_det_lin.co_section, sal_f_sales_det_lin.id_tax, sal_f_sales_det_lin.co_product, sal_f_sales_det_lin.id_offer, sal_f_sales_det_lin.vl_amount, sal_f_sales_det_lin.id_format, sal_f_sales_det_lin.co_auxiliar
  • Buffers: shared hit=4338317
  • Worker 0: actual time=0.124..4833.355 rows=2640433 loops=1
  • Buffers: shared hit=1425338
  • Worker 1: actual time=0.084..4786.478 rows=2632849 loops=1
  • Buffers: shared hit=1440413
  • Worker 2: actual time=0.087..4747.989 rows=2584795 loops=1
  • Buffers: shared hit=1383648
3. 27.807 147.488 ↑ 1.3 207,169 4 / 4

Append (cost=0.00..14,218.72 rows=267,316 width=45) (actual time=0.020..147.488 rows=207,169 loops=4)

  • Buffers: shared hit=10209
  • Worker 0: actual time=0.025..193.788 rows=272202 loops=1
  • Buffers: shared hit=3286
  • Worker 1: actual time=0.019..190.891 rows=275350 loops=1
  • Buffers: shared hit=3439
  • Worker 2: actual time=0.024..184.675 rows=264100 loops=1
  • Buffers: shared hit=3311
4. 0.001 0.001 ↓ 0.0 0 4 / 4

Parallel Seq Scan on public.sal_f_sales_det_cab (cost=0.00..0.00 rows=1 width=92) (actual time=0.001..0.001 rows=0 loops=4)

  • Output: sal_f_sales_det_cab.id_store, sal_f_sales_det_cab.id_tpv, sal_f_sales_det_cab.id_ticket, sal_f_sales_det_cab.id_cash, sal_f_sales_det_cab.dt_sale, sal_f_sales_det_cab.ti_hour, sal_f_sales_det_cab.id_ticket_type, sal_f_sales_det_cab.vl_sale, sal_f_sales_det_cab.co_service, sal_f_sales_det_cab.co_card
  • Filter: ((sal_f_sales_det_cab.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_cab.dt_sale <= '2020-04-30'::date))
  • Worker 0: actual time=0.000..0.000 rows=0 loops=1
  • Worker 1: actual time=0.000..0.000 rows=0 loops=1
  • Worker 2: actual time=0.001..0.001 rows=0 loops=1
5. 119.680 119.680 ↑ 1.3 207,169 4 / 4

Parallel Seq Scan on public.sal_f_sales_det_cab_202004 (cost=0.00..14,218.72 rows=267,315 width=45) (actual time=0.019..119.680 rows=207,169 loops=4)

  • Output: sal_f_sales_det_cab_202004.id_store, sal_f_sales_det_cab_202004.id_tpv, sal_f_sales_det_cab_202004.id_ticket, sal_f_sales_det_cab_202004.id_cash, sal_f_sales_det_cab_202004.dt_sale, sal_f_sales_det_cab_202004.ti_hour, sal_f_sales_det_cab_202004.id_ticket_type, sal_f_sales_det_cab_202004.vl_sale, sal_f_sales_det_cab_202004.co_service, sal_f_sales_det_cab_202004.co_card
  • Filter: ((sal_f_sales_det_cab_202004.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_cab_202004.dt_sale <= '2020-04-30'::date))
  • Buffers: shared hit=10209
  • Worker 0: actual time=0.024..157.086 rows=272202 loops=1
  • Buffers: shared hit=3286
  • Worker 1: actual time=0.018..155.552 rows=275350 loops=1
  • Buffers: shared hit=3439
  • Worker 2: actual time=0.023..148.414 rows=264100 loops=1
  • Buffers: shared hit=3311
6. 621.507 2,693.197 ↓ 5.0 10 828,676 / 4

Append (cost=0.00..1.07 rows=2 width=83) (actual time=0.009..0.013 rows=10 loops=828,676)

  • Buffers: shared hit=4328108
  • Worker 0: actual time=0.008..0.012 rows=10 loops=272202
  • Buffers: shared hit=1422052
  • Worker 1: actual time=0.008..0.012 rows=10 loops=275350
  • Buffers: shared hit=1436974
  • Worker 2: actual time=0.008..0.012 rows=10 loops=264100
  • Buffers: shared hit=1380337
7. 0.000 0.000 ↓ 0.0 0 828,676 / 4

Seq Scan on public.sal_f_sales_det_lin (cost=0.00..0.00 rows=1 width=194) (actual time=0.000..0.000 rows=0 loops=828,676)

  • Output: sal_f_sales_det_lin.id_store, sal_f_sales_det_lin.id_tpv, sal_f_sales_det_lin.id_ticket, sal_f_sales_det_lin.id_cash, sal_f_sales_det_lin.dt_sale, sal_f_sales_det_lin.ti_hour, sal_f_sales_det_lin.id_ticket_type, sal_f_sales_det_lin.id_line_type, sal_f_sales_det_lin.co_department, sal_f_sales_det_lin.vl_sale_ori, sal_f_sales_det_lin.vl_sale, sal_f_sales_det_lin.qt_units, sal_f_sales_det_lin.co_section, sal_f_sales_det_lin.id_tax, sal_f_sales_det_lin.co_product, sal_f_sales_det_lin.id_offer, sal_f_sales_det_lin.vl_amount, sal_f_sales_det_lin.id_format, sal_f_sales_det_lin.co_auxiliar
  • Filter: ((sal_f_sales_det_lin.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_lin.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_cab.dt_sale = sal_f_sales_det_lin.dt_sale) AND (sal_f_sales_det_cab.ti_hour = sal_f_sales_det_lin.ti_hour) AND (sal_f_sales_det_cab.id_store = sal_f_sales_det_lin.id_store) AND (sal_f_sales_det_cab.id_cash = sal_f_sales_det_lin.id_cash) AND (sal_f_sales_det_cab.id_tpv = sal_f_sales_det_lin.id_tpv) AND (sal_f_sales_det_cab.id_ticket = sal_f_sales_det_lin.id_ticket))
  • Worker 0: actual time=0.000..0.000 rows=0 loops=272202
  • Worker 1: actual time=0.000..0.000 rows=0 loops=275350
  • Worker 2: actual time=0.000..0.000 rows=0 loops=264100
8. 2,071.690 2,071.690 ↓ 10.0 10 828,676 / 4

Index Scan using idx04_sal_f_sales_det_lin_202004 on public.sal_f_sales_det_lin_202004 (cost=0.56..1.07 rows=1 width=83) (actual time=0.007..0.010 rows=10 loops=828,676)

  • Output: sal_f_sales_det_lin_202004.id_store, sal_f_sales_det_lin_202004.id_tpv, sal_f_sales_det_lin_202004.id_ticket, sal_f_sales_det_lin_202004.id_cash, sal_f_sales_det_lin_202004.dt_sale, sal_f_sales_det_lin_202004.ti_hour, sal_f_sales_det_lin_202004.id_ticket_type, sal_f_sales_det_lin_202004.id_line_type, sal_f_sales_det_lin_202004.co_department, sal_f_sales_det_lin_202004.vl_sale_ori, sal_f_sales_det_lin_202004.vl_sale, sal_f_sales_det_lin_202004.qt_units, sal_f_sales_det_lin_202004.co_section, sal_f_sales_det_lin_202004.id_tax, sal_f_sales_det_lin_202004.co_product, sal_f_sales_det_lin_202004.id_offer, sal_f_sales_det_lin_202004.vl_amount, sal_f_sales_det_lin_202004.id_format, sal_f_sales_det_lin_202004.co_auxiliar
  • Index Cond: ((sal_f_sales_det_lin_202004.dt_sale = sal_f_sales_det_cab.dt_sale) AND (sal_f_sales_det_lin_202004.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin_202004.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_lin_202004.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin_202004.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_lin_202004.ti_hour = sal_f_sales_det_cab.ti_hour) AND (sal_f_sales_det_lin_202004.id_store = sal_f_sales_det_cab.id_store) AND (sal_f_sales_det_lin_202004.id_cash = sal_f_sales_det_cab.id_cash) AND (sal_f_sales_det_lin_202004.id_tpv = sal_f_sales_det_cab.id_tpv) AND (sal_f_sales_det_lin_202004.id_ticket = sal_f_sales_det_cab.id_ticket))
  • Buffers: shared hit=4328108
  • Worker 0: actual time=0.007..0.010 rows=10 loops=272202
  • Buffers: shared hit=1422052
  • Worker 1: actual time=0.007..0.010 rows=10 loops=275350
  • Buffers: shared hit=1436974
  • Worker 2: actual time=0.007..0.010 rows=10 loops=264100
  • Buffers: shared hit=1380337
Planning time : 38.372 ms
Execution time : 9,566.636 ms