explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lKEa

Settings
# exclusive inclusive rows x rows loops node
1. 29.220 5,431.124 ↑ 1.0 1 1

Aggregate (cost=287,700.46..287,700.47 rows=1 width=8) (actual time=5,431.123..5,431.124 rows=1 loops=1)

2. 4,130.970 5,401.904 ↓ 1.1 430,036 1

Unique (cost=223,606.54..282,693.13 rows=400,587 width=772) (actual time=1,120.212..5,401.904 rows=430,036 loops=1)

3. 924.834 1,270.934 ↓ 1.1 430,036 1

Sort (cost=223,606.54..224,608.01 rows=400,587 width=772) (actual time=1,120.211..1,270.934 rows=430,036 loops=1)

  • Sort Key: main_order.id, main_order.status, main_order.additional_status, main_order.pay_type_id, main_order.pay_status, main_order.sale, main_order.purchase, main_order.sale_result, main_order.refund_sum, main_order.operator_id, main_order.operator_prev_id, main_order.site_id, main_order.client_id, main_order.client_address, main_order.client_subway, main_order.client_post_code, main_order.client_location, main_order.client_referer, main_order.client_ip, main_order.delivery_type, main_order.delivery_status, main_order.datetime_delivery_st, main_order.datetime_delivery_fn, main_order.datetime_ransom_st, main_order.datetime_ransom_fn, main_order.courier_id, main_order.courier_pay, main_order.courier_pay_sum, main_order.courier_trip, main_order.purchase_sum, main_order.comment, main_order.client_comment, main_order.info, main_order.rejection, main_order.datetime_action, main_order.datetime_create, main_order.datetime_sale, main_order.datetime_complete, main_order.is_staff, main_order.is_check, main_order.is_check2, main_order.old_bintranet_id, main_order.custom_id, main_order.certificate_id, main_order.promocode, main_order.language, main_order.device, main_order.transition, main_order.advert, main_order.advertising_company, main_order.transition_string, main_order.advertising_campaign_id, main_order.advertising_group_id, main_order.term_id, main_order.utm, main_order.cid, main_order.calls, main_order.data
  • Sort Method: external merge Disk: 269,248kB
4. 214.515 346.100 ↓ 1.1 430,036 1

Hash Join (cost=83.87..49,408.41 rows=400,587 width=772) (actual time=0.661..346.100 rows=430,036 loops=1)

  • Hash Cond: (main_order.site_id = main_site.id)
5. 130.947 130.947 ↓ 1.0 433,280 1

Seq Scan on main_order (cost=0.00..48,197.09 rows=426,669 width=772) (actual time=0.010..130.947 rows=433,280 loops=1)

  • Filter: ((datetime_create >= '2018-04-20 00:00:00+03'::timestamp with time zone) AND (id >= 606,619))
  • Rows Removed by Filter: 5,466
6. 0.186 0.638 ↓ 1.0 601 1

Hash (cost=76.38..76.38 rows=599 width=4) (actual time=0.638..0.638 rows=601 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 30kB
7. 0.452 0.452 ↓ 1.0 601 1

Seq Scan on main_site (cost=0.00..76.38 rows=599 width=4) (actual time=0.009..0.452 rows=601 loops=1)

  • Filter: is_active
  • Rows Removed by Filter: 40
Planning time : 1.356 ms
Execution time : 5,468.312 ms