explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZDSk

Settings
# exclusive inclusive rows x rows loops node
1. 1,738.968 5,382.472 ↑ 407.5 4,350,776 1

WindowAgg (cost=303,418,767.22..343,307,376.02 rows=1,772,827,058 width=20) (actual time=3,458.726..5,382.472 rows=4,350,776 loops=1)

2. 1,378.506 3,643.504 ↑ 407.5 4,350,776 1

Sort (cost=303,418,767.22..307,850,834.86 rows=1,772,827,058 width=12) (actual time=3,458.715..3,643.504 rows=4,350,776 loops=1)

  • Sort Key: tmp_shops_relations.visitable_shop_id, delivery_data_2019_q2.delivery_group_id, delivery_data_2019_q2.delivery_date DESC
  • Sort Method: quicksort Memory: 323410kB
3. 299.098 2,264.998 ↑ 407.5 4,350,776 1

Nested Loop (cost=0.43..785,011.24 rows=1,772,827,058 width=12) (actual time=0.028..2,264.998 rows=4,350,776 loops=1)

4. 2.960 2.960 ↑ 1.0 40,060 1

Seq Scan on tmp_shops_relations (cost=0.00..617.60 rows=40,060 width=8) (actual time=0.011..2.960 rows=40,060 loops=1)

5. 200.300 1,962.940 ↑ 1.2 109 40,060

Append (cost=0.43..18.22 rows=136 width=12) (actual time=0.005..0.049 rows=109 loops=40,060)

6. 801.200 801.200 ↑ 1.2 50 40,060

Index Scan using delivery_data_2019_q2_id_client_tt_idx2 on delivery_data_2019_q2 (cost=0.43..8.10 rows=59 width=12) (actual time=0.004..0.020 rows=50 loops=40,060)

  • Index Cond: (id_client_tt = tmp_shops_relations.final_shop_id)
  • Filter: ((amount > '0'::numeric) AND (delivery_date > '2019-04-04'::date))
  • Rows Removed by Filter: 3
7. 841.260 841.260 ↑ 1.2 55 40,060

Index Scan using delivery_data_2019_q3_id_client_tt_idx2 on delivery_data_2019_q3 (cost=0.43..8.38 rows=65 width=12) (actual time=0.003..0.021 rows=55 loops=40,060)

  • Index Cond: (id_client_tt = tmp_shops_relations.final_shop_id)
  • Filter: ((amount > '0'::numeric) AND (delivery_date > '2019-04-04'::date))
  • Rows Removed by Filter: 1
8. 120.180 120.180 ↑ 3.0 4 40,060

Index Scan using delivery_data_2019_q4_id_client_tt_idx2 on delivery_data_2019_q4 (cost=0.42..1.06 rows=12 width=12) (actual time=0.002..0.003 rows=4 loops=40,060)

  • Index Cond: (id_client_tt = tmp_shops_relations.final_shop_id)
  • Filter: ((amount > '0'::numeric) AND (delivery_date > '2019-04-04'::date))
  • Rows Removed by Filter: 0
Planning time : 2.288 ms
Execution time : 5,497.941 ms