explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C4qS : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #8tg; plan #9rN1; plan #KO6D; plan #Jn51; plan #5S8s; plan #rQtg; plan #e8ot; plan #x1v9; plan #60x7; plan #OmB0s; plan #kT8M; plan #hBBo; plan #PBsg; plan #jWRF; plan #vUhJ; plan #guMs; plan #tNcR; plan #AIoi; plan #7xDy; plan #i9ct; plan #aXXT; plan #W38d; plan #bZt4; plan #ECjq; plan #yhLv; plan #gq6g

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 16.376 3,561.550 ↑ 1.0 1 1

Aggregate (cost=706,975.61..706,975.62 rows=1 width=8) (actual time=3,561.550..3,561.550 rows=1 loops=1)

2.          

CTE filtered_orders

3. 239.333 647.240 ↑ 1.3 158,830 1

HashAggregate (cost=229,836.92..231,830.87 rows=199,395 width=589) (actual time=536.952..647.240 rows=158,830 loops=1)

  • Group Key: o_1.id, o_1.deleted, o_1.id_ek5, o_1.number, o_1.online_shop, o_1.date_time_create
4. 13.887 407.907 ↑ 1.3 158,838 1

Append (cost=0.56..226,845.99 rows=199,395 width=589) (actual time=0.069..407.907 rows=158,838 loops=1)

5. 393.898 393.898 ↑ 1.3 158,823 1

Index Scan using idx_order_sender_code_number_department on "order" o_1 (cost=0.56..223,539.05 rows=199,119 width=249) (actual time=0.067..393.898 rows=158,823 loops=1)

  • Index Cond: (((sender_contragent_code)::text = '559e77c152183b66ba17f085'::text) AND (deleted = false) AND (date_time_create >= '2019-08-12 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-09-14 23:59:59'::timestamp without time zone))
  • Filter: (NOT deleted)
6. 0.068 0.068 ↑ 6.6 7 1

Index Scan using idx_order_receiver_code_number_department on "order" o_2 (cost=0.56..53.41 rows=46 width=249) (actual time=0.053..0.068 rows=7 loops=1)

  • Index Cond: (((receiver_contragent_code)::text = '559e77c152183b66ba17f085'::text) AND (deleted = false) AND (date_time_create >= '2019-08-12 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-09-14 23:59:59'::timestamp without time zone))
  • Filter: (NOT deleted)
7. 0.054 0.054 ↑ 28.8 8 1

Index Scan using idx_order_payer_code_number_department on "order" o_3 (cost=0.56..262.60 rows=230 width=249) (actual time=0.037..0.054 rows=8 loops=1)

  • Index Cond: (((payer_contragent_code)::text = '559e77c152183b66ba17f085'::text) AND (deleted = false) AND (date_time_create >= '2019-08-12 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-09-14 23:59:59'::timestamp without time zone))
  • Filter: (NOT deleted)
8. 98.301 3,545.174 ↑ 1.3 158,830 1

Nested Loop (cost=0.56..472,652.30 rows=199,395 width=2,051) (actual time=537.034..3,545.174 rows=158,830 loops=1)

9. 746.763 746.763 ↑ 1.3 158,830 1

CTE Scan on filtered_orders t (cost=0.00..3,987.90 rows=199,395 width=16) (actual time=536.956..746.763 rows=158,830 loops=1)

10. 2,700.110 2,700.110 ↑ 1.0 1 158,830

Index Scan using "idx-order_id" on "order" o (cost=0.56..2.35 rows=1 width=2,071) (actual time=0.017..0.017 rows=1 loops=158,830)

  • Index Cond: (id = t.id)
Planning time : 2.107 ms
Execution time : 3,573.259 ms