explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LgcH

Settings
# exclusive inclusive rows x rows loops node
1. 121.926 115,079.932 ↑ 1.0 1 1

Aggregate (cost=689,658.94..689,658.95 rows=1 width=8) (actual time=115,079.932..115,079.932 rows=1 loops=1)

2.          

CTE filtered_orders

3. 906.534 42,825.555 ↑ 1.2 158,822 1

HashAggregate (cost=223,873.31..225,813.86 rows=194,055 width=589) (actual time=42,502.926..42,825.555 rows=158,822 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. 66.713 41,919.021 ↑ 1.2 158,830 1

Append (cost=0.56..220,962.48 rows=194,055 width=589) (actual time=0.732..41,919.021 rows=158,830 loops=1)

5. 41,849.865 41,849.865 ↑ 1.2 158,815 1

Index Scan using idx_order_sender_code_number_department on "order" o_1 (cost=0.56..217,745.76 rows=193,788 width=248) (actual time=0.730..41,849.865 rows=158,815 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. 2.028 2.028 ↑ 6.0 7 1

Index Scan using idx_order_receiver_code_number_department on "order" o_2 (cost=0.56..48.91 rows=42 width=248) (actual time=0.414..2.028 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.415 0.415 ↑ 28.1 8 1

Index Scan using idx_order_payer_code_number_department on "order" o_3 (cost=0.56..256.99 rows=225 width=248) (actual time=0.393..0.415 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. 426.928 114,958.006 ↑ 1.2 158,822 1

Nested Loop (cost=0.56..461,419.40 rows=194,055 width=2,049) (actual time=42,504.911..114,958.006 rows=158,822 loops=1)

9. 43,220.000 43,220.000 ↑ 1.2 158,822 1

CTE Scan on filtered_orders t (cost=0.00..3,881.10 rows=194,055 width=16) (actual time=42,502.934..43,220.000 rows=158,822 loops=1)

10. 71,311.078 71,311.078 ↑ 1.0 1 158,822

Index Scan using "idx-order_id" on "order" o (cost=0.56..2.36 rows=1 width=2,069) (actual time=0.449..0.449 rows=1 loops=158,822)

  • Index Cond: (id = t.id)
Planning time : 15.722 ms
Execution time : 115,111.829 ms