explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vs2q : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #x38Q; plan #BUZl; plan #BPsk; plan #x1gn; plan #VRP7; plan #Bjlf; plan #hxJi; plan #Demz

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 118.868 66,592.396 ↑ 1.0 1 1

Aggregate (cost=706,974.51..706,974.52 rows=1 width=8) (actual time=66,592.396..66,592.396 rows=1 loops=1)

2.          

CTE filtered_orders

3. 442.458 888.223 ↑ 1.3 158,830 1

HashAggregate (cost=229,835.82..231,829.77 rows=199,395 width=589) (actual time=579.629..888.223 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. 15.954 445.765 ↑ 1.3 158,838 1

Append (cost=0.56..226,844.89 rows=199,395 width=589) (actual time=0.094..445.765 rows=158,838 loops=1)

5. 429.705 429.705 ↑ 1.3 158,823 1

Index Scan using idx_order_sender_code_number_department on "order" o_1 (cost=0.56..223,537.95 rows=199,119 width=249) (actual time=0.093..429.705 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.057 0.057 ↑ 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.044..0.057 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.049 0.049 ↑ 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.032..0.049 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. 374.546 66,473.528 ↑ 1.3 158,830 1

Nested Loop (cost=0.56..472,652.30 rows=199,395 width=2,051) (actual time=579.807..66,473.528 rows=158,830 loops=1)

9. 1,296.342 1,296.342 ↑ 1.3 158,830 1

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

10. 64,802.640 64,802.640 ↑ 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.408..0.408 rows=1 loops=158,830)

  • Index Cond: (id = t.id)
Planning time : 2.212 ms
Execution time : 66,609.023 ms