explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4MX6

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 2.326 ↓ 0.0 0 1

Unique (cost=555.67..555.78 rows=1 width=2,104) (actual time=2.326..2.326 rows=0 loops=1)

2. 0.074 2.326 ↓ 0.0 0 1

Sort (cost=555.67..555.68 rows=1 width=2,104) (actual time=2.326..2.326 rows=0 loops=1)

  • Sort Key: o.create_date DESC, o.id, o.enabled, o.is_deleted, o.update_date, o.authorization_code, o.cancelled, o.code, o.customer_note, o.delivery_date, o.discount_total, o.gross_total, o.is_error, o.is_synced, o.logical_ref, o.order_date, o.order_type, o.pre_vat_net_total, o.receipt_number, o.salesman_note, o.special_code, o.sync_message, o.uuid, o.vat_included_total, o.vat_total, o.customer_id, o.customer_branch_id, o.payment_type_id, o.route_detail_id, o.warehouse_id, o.location_message, o.route_status, o.salesman_customer_distance, o.salesman_latitude, o.salesman_longitude, o.order_source, o.is_deleted_remote_order, o.invoice_status, o.order_status, o.ship_date, o.waybill_status, o.manager_id
  • Sort Method: quicksort Memory: 25kB
3. 0.000 2.252 ↓ 0.0 0 1

Nested Loop (cost=200.31..555.66 rows=1 width=2,104) (actual time=2.252..2.252 rows=0 loops=1)

4. 0.001 2.252 ↓ 0.0 0 1

Nested Loop (cost=200.02..547.34 rows=1 width=2,104) (actual time=2.251..2.252 rows=0 loops=1)

5. 0.000 2.251 ↓ 0.0 0 1

Nested Loop (cost=200.02..545.16 rows=1 width=2,104) (actual time=2.251..2.251 rows=0 loops=1)

6. 0.001 2.251 ↓ 0.0 0 1

Nested Loop (cost=199.59..536.71 rows=1 width=2,104) (actual time=2.251..2.251 rows=0 loops=1)

7. 0.004 2.250 ↓ 0.0 0 1

Bitmap Heap Scan on orders o (cost=199.31..307.61 rows=28 width=2,104) (actual time=2.250..2.250 rows=0 loops=1)

  • Recheck Cond: ((salesman_id = 55) AND (distributor_id = 4))
8. 0.015 2.246 ↓ 0.0 0 1

BitmapAnd (cost=199.31..199.31 rows=28 width=0) (actual time=2.246..2.246 rows=0 loops=1)

9. 0.032 0.032 ↑ 6.2 72 1

Bitmap Index Scan on orders_salesman_idx (cost=0.00..11.76 rows=445 width=0) (actual time=0.032..0.032 rows=72 loops=1)

  • Index Cond: (salesman_id = 55)
10. 2.199 2.199 ↑ 1.0 9,857 1

Bitmap Index Scan on orders_distributor_idz (cost=0.00..187.28 rows=9,982 width=0) (actual time=2.199..2.199 rows=9,857 loops=1)

  • Index Cond: (distributor_id = 4)
11. 0.000 0.000 ↓ 0.0 0

Index Scan using customer_pkey on customer c (cost=0.29..8.17 rows=1 width=46) (never executed)

  • Index Cond: (id = o.customer_id)
  • Filter: ((upper((o.receipt_number)::text) ~~ '%test%'::text) OR (upper((name)::text) ~~ '%test%'::text))
12. 0.000 0.000 ↓ 0.0 0

Index Scan using orders_detail_pkey on order_detail od (cost=0.43..8.45 rows=1 width=8) (never executed)

  • Index Cond: (id = o.id)
  • Filter: ((shipped_quantity)::numeric < quantity)
13. 0.000 0.000 ↓ 0.0 0

Seq Scan on distributor d (cost=0.00..2.17 rows=1 width=8) (never executed)

  • Filter: (id = 4)
14. 0.000 0.000 ↓ 0.0 0

Index Only Scan using salesman_pkey on salesman s (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (id = 55)
  • Heap Fetches: 0
Planning time : 3.303 ms
Execution time : 2.648 ms