explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1lfR : idx02_sal_f_sales_det_cab_201712

Settings
# exclusive inclusive rows x rows loops node
1. 5,830.639 13,082.458 ↓ 8,007,249.0 8,007,249 1

Gather (cost=1,000.00..306,403.95 rows=1 width=128) (actual time=35.253..13,082.458 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=4170573 read=168407
  • I/O Timings: read=10141.981
2. 1,217.813 7,251.819 ↓ 2,001,812.0 2,001,812 4 / 4

Nested Loop (cost=0.00..305,403.85 rows=1 width=128) (actual time=7.901..7,251.819 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=4169910 read=168407
  • I/O Timings: read=10141.981
  • Worker 0: actual time=8.503..8240.313 rows=2516610 loops=1
  • Buffers: shared hit=1317534 read=52599
  • I/O Timings: read=2952.391
  • Worker 1: actual time=2.914..8235.455 rows=2546627 loops=1
  • Buffers: shared hit=1329459 read=53086
  • I/O Timings: read=2930.587
  • Worker 2: actual time=11.174..8218.135 rows=2489722 loops=1
  • Buffers: shared hit=1292251 read=52365
  • I/O Timings: read=2940.298
3. 32.472 233.274 ↑ 1.3 207,169 4 / 4

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

  • Buffers: shared read=10209
  • I/O Timings: read=248.901
  • Worker 0: actual time=5.176..270.563 rows=261601 loops=1
  • Buffers: shared read=3206
  • I/O Timings: read=60.176
  • Worker 1: actual time=0.067..261.745 rows=264044 loops=1
  • Buffers: shared read=3201
  • I/O Timings: read=55.281
  • Worker 2: actual time=5.677..269.645 rows=256995 loops=1
  • Buffers: shared read=3129
  • I/O Timings: read=59.328
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. 200.801 200.801 ↑ 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=3.926..200.801 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 read=10209
  • I/O Timings: read=248.901
  • Worker 0: actual time=5.174..229.175 rows=261601 loops=1
  • Buffers: shared read=3206
  • I/O Timings: read=60.176
  • Worker 1: actual time=0.066..222.618 rows=264044 loops=1
  • Buffers: shared read=3201
  • I/O Timings: read=55.281
  • Worker 2: actual time=5.676..228.074 rows=256995 loops=1
  • Buffers: shared read=3129
  • I/O Timings: read=59.328
6. 1,035.845 5,800.732 ↓ 5.0 10 828,676 / 4

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

  • Buffers: shared hit=4169910 read=158198
  • I/O Timings: read=9893.080
  • Worker 0: actual time=0.015..0.025 rows=10 loops=261601
  • Buffers: shared hit=1317534 read=49393
  • I/O Timings: read=2892.215
  • Worker 1: actual time=0.015..0.025 rows=10 loops=264044
  • Buffers: shared hit=1329459 read=49885
  • I/O Timings: read=2875.306
  • Worker 2: actual time=0.015..0.025 rows=10 loops=256995
  • Buffers: shared hit=1292251 read=49236
  • I/O Timings: read=2880.970
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=261601
  • Worker 1: actual time=0.000..0.000 rows=0 loops=264044
  • Worker 2: actual time=0.000..0.000 rows=0 loops=256995
8. 4,764.887 4,764.887 ↓ 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.014..0.023 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=4169910 read=158198
  • I/O Timings: read=9893.080
  • Worker 0: actual time=0.013..0.022 rows=10 loops=261601
  • Buffers: shared hit=1317534 read=49393
  • I/O Timings: read=2892.215
  • Worker 1: actual time=0.013..0.022 rows=10 loops=264044
  • Buffers: shared hit=1329459 read=49885
  • I/O Timings: read=2875.306
  • Worker 2: actual time=0.014..0.023 rows=10 loops=256995
  • Buffers: shared hit=1292251 read=49236
  • I/O Timings: read=2880.970
Planning time : 43.576 ms
Execution time : 13,649.522 ms