explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vl3a

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 891.418 ↓ 0.0 0 1

Sort (cost=103,616.94..103,616.94 rows=1 width=168) (actual time=891.418..891.418 rows=0 loops=1)

  • Sort Key: main_order.datetime_create
  • Sort Method: quicksort Memory: 25kB
2. 0.002 891.391 ↓ 0.0 0 1

Nested Loop (cost=86,905.22..103,616.93 rows=1 width=168) (actual time=891.391..891.391 rows=0 loops=1)

3. 154.013 891.389 ↓ 0.0 0 1

Bitmap Heap Scan on main_order (cost=86,904.94..103,614.42 rows=1 width=211) (actual time=891.389..891.389 rows=0 loops=1)

  • Recheck Cond: (((operator_id IS NULL) AND (operator_id IS NULL)) OR ((operator_id = 263) AND (operator_id IS NULL)))
  • Filter: ((id >= 606619) AND (status <> 0) AND (NOT (hashed SubPlan 1)) AND (status = 1) AND (((operator_id IS NULL) AND (status = ANY ('{1,23,30,37,39}'::integer[]))) OR (operator_id = 263)) AND (((datetime_action >= '2020-02-05 09:56:22.56822+03'::timestamp with time zone) AND (status = ANY ('{10,11,16,23,25}'::integer[]))) OR ((status <> ALL ('{10,11,16,23,25}'::integer[])) AND (datetime_action >= '2019-12-26 09:56:22.56822+03'::timestamp with time zone)) OR (status = ANY ('{17,19}'::integer[]))))
  • Rows Removed by Filter: 105183
  • Heap Blocks: exact=45742
4. 0.001 15.312 ↓ 0.0 0 1

BitmapOr (cost=229.26..229.26 rows=16,791 width=0) (actual time=15.312..15.312 rows=0 loops=1)

5. 15.310 15.310 ↓ 6.3 105,183 1

Bitmap Index Scan on main_order_operator_id_4e9ecae4 (cost=0.00..226.47 rows=16,664 width=0) (actual time=15.310..15.310 rows=105,183 loops=1)

  • Index Cond: ((operator_id IS NULL) AND (operator_id IS NULL))
6. 0.001 0.001 ↓ 0.0 0 1

Bitmap Index Scan on main_order_operator_id_4e9ecae4 (cost=0.00..2.79 rows=127 width=0) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: ((operator_id = 263) AND (operator_id IS NULL))
7.          

SubPlan (for Bitmap Heap Scan)

8. 0.000 722.064 ↓ 131,351.0 131,351 1

Gather (cost=1,002.02..86,675.68 rows=1 width=4) (actual time=0.436..722.064 rows=131,351 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 217.477 722.319 ↓ 43,784.0 43,784 3 / 3

Merge Left Join (cost=2.02..85,675.58 rows=1 width=4) (actual time=4.625..722.319 rows=43,784 loops=3)

  • Merge Cond: (u0.id = u1.order_id)
  • Filter: (u1.id IS NULL)
  • Rows Removed by Filter: 337681
10. 93.822 93.822 ↑ 1.2 218,175 3 / 3

Parallel Index Only Scan using main_order_pkey on main_order u0 (cost=0.42..31,467.63 rows=272,125 width=4) (actual time=0.068..93.822 rows=218,175 loops=3)

  • Heap Fetches: 75264
11. 411.020 411.020 ↑ 1.0 1,012,722 3 / 3

Index Scan using main_ticket_order_id_b5458a7e on main_ticket u1 (cost=0.42..48,631.99 rows=1,048,064 width=8) (actual time=0.073..411.020 rows=1,012,722 loops=3)

12. 0.000 0.000 ↓ 0.0 0

Index Scan using main_site_pkey on main_site (cost=0.28..2.49 rows=1 width=4) (never executed)

  • Index Cond: (id = main_order.site_id)
  • Filter: is_active
Planning time : 2.432 ms
Execution time : 892.563 ms